ORA-01745 Invalid Host/Bind Variable Name: update with rowid

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
David Lipschitz
Posts: 9
Joined: Fri 23 Mar 2012 04:38
Location: Cape Town, South Africa
Contact:

ORA-01745 Invalid Host/Bind Variable Name: update with rowid

Post by David Lipschitz » Fri 23 Mar 2012 09:20

I am porting a project to ODAC and trying to convince a client to move off the BDE. However, I have a problem in a TOraQuery.

The following query returns the error message in the subject:
update aa.accpacarrecon
set amtpaid = (incvat * nvl(totalpaid,0) / :totalinvamt)
where rowid=:rowid

I have replaced the parameters in TOAD and the query works:
update aa.accpacarrecon
set amtpaid = (incvat * nvl(totalpaid,0) / 114193.69)
where rowid='AAAbEpAAMAAAAQjAAR'

The query also worked in the BDE.

Using Delphi 7.

David Lipschitz
Posts: 9
Joined: Fri 23 Mar 2012 04:38
Location: Cape Town, South Africa
Contact:

Post by David Lipschitz » Fri 23 Mar 2012 09:49

I fixed the problem by changing the parameter from :rowid to :rowidvar.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 23 Mar 2012 11:11

Hello,

ROWID is an Oracle keyword, and since we, unlike BDE and ADO, don't change parameter names with their serial numbers (e.g. :rowid -> :1), this problem occurs. Your decision to rename parameters is right.

Post Reply