Page 1 of 1

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

Posted: Fri 23 Mar 2012 09:20
by David Lipschitz
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.

Posted: Fri 23 Mar 2012 09:49
by David Lipschitz
I fixed the problem by changing the parameter from :rowid to :rowidvar.

Posted: Fri 23 Mar 2012 11:11
by AlexP
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.