Parameter reuse in SQL statement
216192Feb 22 2005 — edited Feb 24 2005I'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?