Invalid host/bind variable name ORA-01745

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Valgardur
Posts: 165
Joined: Tue 24 Nov 2009 19:33

Invalid host/bind variable name ORA-01745

Post by Valgardur » Thu 16 Feb 2017 17:33

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.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Invalid host/bind variable name ORA-01745

Post by MaximG » Wed 01 Mar 2017 11:30

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

Valgardur
Posts: 165
Joined: Tue 24 Nov 2009 19:33

Re: Invalid host/bind variable name ORA-01745

Post by Valgardur » Wed 01 Mar 2017 12:44

Thanks, but this actually does work in old code (using BDE)

aricjoshua
Posts: 1
Joined: Fri 17 Sep 2021 23:54

Re: Invalid host/bind variable name ORA-01745

Post by aricjoshua » Sat 18 Sep 2021 00:53

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.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Invalid host/bind variable name ORA-01745

Post by MaximG » Tue 21 Sep 2021 12:12

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!

Post Reply