PR# 2833 Faulty {ODBC}.bind_args.value implementation requires all Store_Proc parameter names to be numeric

Problem Report Summary
Submitter:
Category: EiffelStore
Priority: Medium
Date: 2001/04/30
Class: Bug
Severity: Serious
Number: 2833
Release: 4.5
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) Eiffel 4.5; VC++ 6; Windows 2000 Professional; SQL Server 7.0 SP3
Synopsis: Faulty {ODBC}.bind_args.value implementation requires all Store_Proc parameter names to be numeric

Description
Faulty {ODBC}.bind_args.value implementation requires all Store_Proc parameter names to be numeric.

This line (from {ODBC}.bind_args_value fails if the name of an input parameter is not numeric:
uhandle.status.set (odbc_set_parameter (descriptor, uht.key_for_iteration.to_integer, 1, type, para.get (i)));


Workaround:
Name all stored value parameters as numerics.
To Reproduce
Compile the odbc stored value example in EiffelStore. (RUNNER_SEL). Run it. (I even think you might know about this, because you've uncommented the line that calls set_map_name ("author") and replaces it for set_map_name ("?").
Problem Report Interactions
From:    Date:2001/04/30    Download   
State-Changed-From-To: open-open
State-Changed-By: Cedric
State-Changed-When: Mon Apr 30 16:04:02 PDT 2001
State-Changed-Why:
Dear Loryn,

I looked into this problem and the problem seem to be that ODBC requires (in
'SQLBindParameter') to have the number of the parameter to replace, while
Oracle for instance needs the parameter name. EiffelStore implementation
(the HASH_TABLE) is only adapted for the Oracle interface and the
information "parameter number", required for ODBC, is not available. The
current implementation suggests to call the parameters used by their number
to solve this problem, for instance:

author, pages: STRING
selection: DB_SELECTION
(...)
selection.set_map_name (author, "1")
selection.set_map_name (pages, "2")
selection.query ("select * from BOOKS where author = :1 and pages = :2")

--
I unfortunately don't have a better short-term solution for this problem.

Concerning the EiffelStore/2809 bug, did you find out what was the problem?
(was it a problem with your ODBC driver?)