Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call stored procedure and bind parameters by name

3fdfa9ac-ea5d-4c18-b6e7-81b95b678d58Dec 10 2015 — edited Dec 10 2015

Hi,

I am using the Oracle ODBC 12c Driver to pass values from an Interface to our Oracle 11.2 database. The Interface Software gathers the data from modbus protocoll and calls a stored procedure. At the moment my syntax to call the stored procedure looks like this:

call procedure_Name('STRING', 'Timestamp as String', numValue1);

This works fine. Now i have to add a default parameter to my procedure. To stay flexible for further changes i want to call the procedure and bind the parameters by name. Release Notes of ODBC 10.2.0.1.0 sais:

Added support for named parameter, binding parameters by name. Oracle ODBC driver now allows application to specify the parameters to a stored procedure by name, in the procedure call. Named parameters are only to be used in calls to stored procedures, and not to be used in other SQL Statements.

So it should not be a problem to use the named notation, but how would I do this from ODBC? I tried it like this, but oracle returns an ora-00936 missing expression error:

     call procedure_Name(paramName1 => 'STRING',paramName2 => 'Timestamp as String',paramName3 => numValue1);


Thank you for your Help.

This post has been answered by 3fdfa9ac-ea5d-4c18-b6e7-81b95b678d58 on Dec 10 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2016
Added on Dec 10 2015
1 comment
2,366 views