ORA-01745: invalid host/bind variable name on some ESQL parameters

ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Dennis Wanke » Thu 27 Mar 2014 07:50

The following Entity SQL query causes "ORA-01745: invalid host/bind variable name":

Code: Select all
SELECT post FROM ForumData.Posts AS post WHERE post.User = @user


The problem is the parameter name that it is not properly escaped when translating to native SQL, in this case :"user" instead of :user.

Note, that ESQL doesn't provide any means for escaping query parameters.
Last edited by Dennis Wanke on Fri 11 Apr 2014 10:53, edited 1 time in total.
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Shalex » Thu 27 Mar 2014 12:16

We have reproduced the issue with :user parameter. We will investigate it and notify you about the result. As a workaround, please rename your parameter.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Shalex » Wed 09 Apr 2014 14:16

The bug with using reserved words in the names of ESQL parameters is fixed. We will notify you when the corresponding build of dotConnect for Oracle is available for download.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Shalex » Thu 10 Apr 2014 14:40

New build of dotConnect for Oracle 8.3.135 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=29348.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Dennis Wanke » Fri 11 Apr 2014 10:51

The ORA-01745 is gone but now I'm getting "ORA-01036 illegal variable name/number" when using "user" as a parameter name. It seems that there is simply no way to use such query parameters in Oracle (i.e. :user). If so, the fix have to be a bit more involved, e.g. prefixing parameters with "p_" or so under the hood. If it's not feasible, it would be better to rollback the fix, since ORA-01745 is more informative than ORA-01036.
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Shalex » Tue 15 Apr 2014 15:37

1. Please send us a small test project with the corresponding DDL/DML script for reproducing.
2. Specify your connection mode (Direct or OCI), the versions of your Oracle server and Oracle client.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Dennis Wanke » Thu 24 Apr 2014 10:23

I sent you a test project.
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Shalex » Mon 28 Apr 2014 15:23

We have reproduced the issue and are investigating it. It is specific to Direct mode. As a workaround, please use the OCI mode (via Oracle client).
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01745: invalid host/bind variable name on some ESQL parameters

Postby Shalex » Fri 24 Oct 2014 17:24

Please try using the latest (8.4.274) build of dotConnect for Oracle. The problem is fixed.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle