Problem with bind variables in direct mode

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Problem with bind variables in direct mode

Post by DarrenColes » Mon 17 Sep 2007 14:07

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.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 18 Sep 2007 09:18

We are investigating this behaviour.
Look forward to hearing from me again.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 20 Sep 2007 14:23

Unfortunately, we cannot fix this. You should not repeat parameters.

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Fri 21 Sep 2007 08:17

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.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 21 Sep 2007 12:16

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.

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Fri 21 Sep 2007 13:26

thanks for the additional update.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 21 Sep 2007 14:11

Not at all.

vzczc
Posts: 3
Joined: Fri 05 Sep 2008 10:09

What is the status on the repeated parameter issue?

Post by vzczc » Fri 05 Sep 2008 11:42

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?

vzczc
Posts: 3
Joined: Fri 05 Sep 2008 10:09

Post by vzczc » Sat 04 Oct 2008 12:38

This issue has been fixed in the latest version

Post Reply