Problem with bind variables in direct mode

Problem with bind variables in direct mode

Postby 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.
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby 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

Postby Alexey » Thu 20 Sep 2007 14:23

Unfortunately, we cannot fix this. You should not repeat parameters.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby 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.
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby 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.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby DarrenColes » Fri 21 Sep 2007 13:26

thanks for the additional update.
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby Alexey » Fri 21 Sep 2007 14:11

Not at all.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

What is the status on the repeated parameter issue?

Postby 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

Postby vzczc » Sat 04 Oct 2008 12:38

This issue has been fixed in the latest version
vzczc
 
Posts: 3
Joined: Fri 05 Sep 2008 10:09


Return to dotConnect for Oracle