Main| Programming| Travel| Life| Audio Books| Movies| About Me
ORA-01008 not all variables bound.
2009-12-09
Another misleading error message. This time from Oracle's camp:
ORA-01008 not all variables bound.
I got that one when executing Oracle command with SQL text from .NET using Oracle.DataAccess.dll version 2.111.6.20.
Well, the problem was not that I forgot to bind a variable, but that the variable was used more than once in the query text. This problematic behavior of OracleCommand object illustrates that the names of the Oracle command parameters are not really used to identify parameters. What is important is the order and number of parameters. In one case, I had to troubleshoot a stored procedure call in which, it seemed, a wrong value was being passed from C# to Oracle. Finally, I realized that the order of Oracle command parameters in C# did not match the order of parameters in SQL, and the values of two variables were being swapped in that call, while completely ignoring parameter names.