Page 1 of 1

Invalid host/bind variable name ORA-01745

Posted: Thu 16 Feb 2017 17:33
by Valgardur
While updating a old application I get "invalid host/bind variable name" for a query

Code: Select all

select Pot, count(*) value
from Pots
WHERE Pot BETWEEN :PotFrom AND :PotTo 
  and Dt >= ( :Date -10 )
  and Dt < (:Date + 1)
Group by Pot
When trying to work with TOraQuery.

If I change ":Date" to something else, ":Dat" everything is fine.

The problem is probably the fact the "Date" is a reserved word, but in this case, only as a parameter.

And yes (long explanation, but) simply changing to ":Dat" will take (almost) forever.

Re: Invalid host/bind variable name ORA-01745

Posted: Wed 01 Mar 2017 11:30
by MaximG
You cannot use an auxiliary word DATE as a query parameter name, it is Oracle server restriction that is demonstrated by the error ORA-01745

Re: Invalid host/bind variable name ORA-01745

Posted: Wed 01 Mar 2017 12:44
by Valgardur
Thanks, but this actually does work in old code (using BDE)

Re: Invalid host/bind variable name ORA-01745

Posted: Sat 18 Sep 2021 00:53
by aricjoshua
After doing some research, I discovered that a recent Windows 10 upgrade had screwed up numerous system files. The installation of the Access Database Engine was suggested. This is what I did, and our issues were resolved.

Re: Invalid host/bind variable name ORA-01745

Posted: Tue 21 Sep 2021 12:12
by MaximG
Hi there!

Thnak you for your reply!
Please explain how the Access Database Engine installation is related to the ORA-01745 error?
Looking forward to your reply!