Skip to Main Content

ODP.NET

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!

Parameter reuse in SQL statement

216192Feb 22 2005 — edited Feb 24 2005
I'm trying to convert to ODP.NET (version 10.1.0.200) from the Microsoft OracleClient. With the ms client I was able to reuse parameters within the sql statement multiple time. It appears with ODP.NET I can only do this one time with one parameter - after that an ora-01008 is thrown.

For example:
cmd.commandText = "select count(*) from some_table where (dept_no = :deptNo or :deptNo is null) and (emp_no = :empNo or :empNo is null)"

Above would work in ms OracleClient but doesn't appear to in ODP.NET. I am correctly adding the parameters to the command - everything works fine until I add the second occurrence of the second parm...

Has anyone else run into this or found a fix?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2005
Added on Feb 22 2005
1 comment
423 views