Page 1 of 1

Problem with bind variables in direct mode

Posted: Mon 17 Sep 2007 14:07
by DarrenColes
Using the latest version of OraDirect 4.20 the following fails with:

ORA-01008: not all variables bound

Code: Select all

            OracleConnection oc = new OracleConnection();
            oc.Direct = true;
            oc.Server = "server";
            oc.Sid="sid";
            oc.UserId="username";
            oc.Password="password";
            oc.Open();

            OracleCommand ocmd = oc.CreateCommand();
            ocmd.ParameterCheck = true;
            ocmd.CommandText = "select :p1,:p1,:p2 from dual";
            ocmd.Prepare();
            ocmd.Parameters["p1"].Value = "00000";
            ocmd.Parameters["p2"].Value = "00001";
            OracleDataReader or = ocmd.ExecuteReader();
This works fine when Direct=false.

Seems to be related to the fact that there is a repeated parameter in the query.

Posted: Tue 18 Sep 2007 09:18
by Alexey
We are investigating this behaviour.
Look forward to hearing from me again.

Posted: Thu 20 Sep 2007 14:23
by Alexey
Unfortunately, we cannot fix this. You should not repeat parameters.

Posted: Fri 21 Sep 2007 08:17
by DarrenColes
thats a shame because it works correctly when direct mode = false and we already have a number of queries that do this.

It means we will not be able to continue our investigation into using direct mode. Maybe you could update the documentation to list this as a limitation of direct mode so that other people are aware of this issue before devoting alot of time to trying to use direct mode in these circumstances.

Posted: Fri 21 Sep 2007 12:16
by Alexey
We are going to overcome this problem in future. But please be warned that this will take much time, so plan your development strategy accordingly.

Posted: Fri 21 Sep 2007 13:26
by DarrenColes
thanks for the additional update.

Posted: Fri 21 Sep 2007 14:11
by Alexey
Not at all.

What is the status on the repeated parameter issue?

Posted: Fri 05 Sep 2008 11:42
by vzczc
I got ORA-01008 (using the latest version of OraDirect as of today) when repeating the same parameter using direct mode.

Works fine for native connection and for SQL Server

Someone earlier in the this thread mentiond that this was an issue to be fixed at some stage.

What is the status?

Posted: Sat 04 Oct 2008 12:38
by vzczc
This issue has been fixed in the latest version