Board index » delphi » Stupid BUG in SQL LINKS ORACLE driver/Delphi

Stupid BUG in SQL LINKS ORACLE driver/Delphi

I am using Delphi 3.01 C/S so I am not sure if it has been fixed in
future versions. I am not even sure if it's a bug or a feature but my
trace into the behaviour have all the tell tale signs of a bug.

Place a TQuery component on a form. The database property should point
to an Oracle alias. I am not sure how it will react to other SQL
servers (or more accurately, how other SQL servers will react to it).
Set the SQL property to a simple statment and qualify the table name
will the schema name as well. For example: select * from schema.table
Turn the Request Live property to TRUE and now try to set the Active
property of TQuery to True. You will get an error message from Oracle
that Table or View does not exist. Your first reaction may be that Live
Queries are not supported on remote SQL servers. Well, that may be true
but that is not what causing the error. You are getting the error from
Oracle and not Delphi....hmmm....
Time to dig in a little: Start SQL Monitor and then run the form
containing your TQuery. You will see that after a bunch of (seemingly
useless) conversation with Oracle, the Delphi sends (Select * from
"schema"."table") to the Oracle server---notice double quotes around
schema and table names. If you take the SQL statement as is, i.e. with
double quotes around the schema and table names and run it any SQL tool
(e.g. SQL WorkSheet from Oracle), you will get the same "Table or View
does not exist" error message. So, it is the quotes which are causing
this error.  FOLKS AT INPRISE SHOULD HAVE KNOWN BETTER.....!!!!

Regards,

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 

Re:Stupid BUG in SQL LINKS ORACLE driver/Delphi


I remember there were some problems with Delphi 3 and Oracle. I`m not sure
but I think you need capital letters for Table- and Columnnames and single-
and doublequotas...
something like this:
select COLUMN from "TABLE" where COLUMN like '''value'''

Christoph

Deja User schrieb in Nachricht <7pehog$1a...@nnrp1.deja.com>...

Quote
>I am using Delphi 3.01 C/S so I am not sure if it has been fixed in
>future versions. I am not even sure if it's a bug or a feature but my
>trace into the behaviour have all the tell tale signs of a bug.

>Place a TQuery component on a form. The database property should point
>to an Oracle alias. I am not sure how it will react to other SQL
>servers (or more accurately, how other SQL servers will react to it).
>Set the SQL property to a simple statment and qualify the table name
>will the schema name as well. For example: select * from schema.table
>Turn the Request Live property to TRUE and now try to set the Active
>property of TQuery to True. You will get an error message from Oracle
>that Table or View does not exist. Your first reaction may be that Live
>Queries are not supported on remote SQL servers. Well, that may be true
>but that is not what causing the error. You are getting the error from
>Oracle and not Delphi....hmmm....
>Time to dig in a little: Start SQL Monitor and then run the form
>containing your TQuery. You will see that after a bunch of (seemingly
>useless) conversation with Oracle, the Delphi sends (Select * from
>"schema"."table") to the Oracle server---notice double quotes around
>schema and table names. If you take the SQL statement as is, i.e. with
>double quotes around the schema and table names and run it any SQL tool
>(e.g. SQL WorkSheet from Oracle), you will get the same "Table or View
>does not exist" error message. So, it is the quotes which are causing
>this error.  FOLKS AT INPRISE SHOULD HAVE KNOWN BETTER.....!!!!

>Regards,

>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

Other Threads