Board index » delphi » TQuery problem -- 'Table Does Not Exist'

TQuery problem -- 'Table Does Not Exist'

Quote
Lizard (liz...@expressway.com) wrote:

: I am having a problem with TQuery, and I'm hoping someone can help me....

: I have a *very* basic query, a simple "select * from MyTable where Somefield=1".
: When I have 'LiveResult' set to false, the query works perfectly, returning
: precisely the data I wish. But when I set LiveResult to *true*, so I can edit
: rows, the query bombs, claiming 'The Table does not exist'. ARRRGHHHH! This
: occurs in both the runtime and design-time environments. The fact that the query
: works under some conditions leads me to conclude the fault, dear Brutus, lies
: not in our SQL, but in our VCL. :)

: I am using ODBC to talk to Oracle Workgroup Server running under Novell. All of
: my TTable components are getting their data without trouble.

Can you post the SQL statement used?

Also, run the ODBC Manager applet in Control Panel, click the Options
button, and enable ODBC trace by making the Trace ODBC Calls checkbox
checked. Run the application and then look at the trace file to see what
ODBC commands were actually sent.

This works for other table access -- ODBC or not. The ODBC vendor, on
seeing the ODBC trace, may be able to advise what is occurring.

--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Steve Koterski               _/   The opinions expressed here are    _/
_/ koter...@borland.com         _/         exclusively my own           _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

Re:TQuery problem -- 'Table Does Not Exist'


I am having a problem with TQuery, and I'm hoping someone can help me....

I have a *very* basic query, a simple "select * from MyTable where Somefield=1".
When I have 'LiveResult' set to false, the query works perfectly, returning
precisely the data I wish. But when I set LiveResult to *true*, so I can edit
rows, the query bombs, claiming 'The Table does not exist'. ARRRGHHHH! This
occurs in both the runtime and design-time environments. The fact that the query
works under some conditions leads me to conclude the fault, dear Brutus, lies
not in our SQL, but in our VCL. :)

I am using ODBC to talk to Oracle Workgroup Server running under Novell. All of
my TTable components are getting their data without trouble.

Thanks in advance for any help.

Evolution Doesn't Take Prisoners:Lizard
Cease then to fashion state-made sin,
And give not your children cause to doubt
That virtue springs from iron within --
Not lead without:Kipling

Re:TQuery problem -- 'Table Does Not Exist'


In article <3v9e9p$goc_...@isdn6-123.dnai.com>,
   liz...@expressway.com (Lizard) wrote:
Quote
>I am having a problem with TQuery, and I'm hoping someone can help me....

>I have a *very* basic query, a simple "select * from MyTable where
Somefield=1".
>When I have 'LiveResult' set to false, the query works perfectly, returning
>precisely the data I wish. But when I set LiveResult to *true*, so I can edit
>rows, the query bombs, claiming 'The Table does not exist'. ARRRGHHHH! This
>occurs in both the runtime and design-time environments. The fact that the
query
>works under some conditions leads me to conclude the fault, dear Brutus, lies
>not in our SQL, but in our VCL. :)

>I am using ODBC to talk to Oracle Workgroup Server running under Novell. All
of
>my TTable components are getting their data without trouble.

We had the same problem trying to get to Oracle 7.1 so I bet our solution
would work in your environment:

Try the following (note the table name is in caps):
  select * from MYTABLE where Somefield=1  

and if that doesn't work then try
  select * from "MYTABLE" where Somefield=1

I'm not sure if the first will work, but I know the second will.  We were
running in to  problems trying to qualify a table name with a schema name
(i.e schema.table) and getting "Invalid token" errors.  That led us to using
the double quotes (per Delphi's Local SQL Syntax help) which led to the "Table
does not exist problem".  Why?  Because if you put quotes around the name then
Oracle does a case-sensitive lookup and we using mixed case names in our
Delphi queries.  So in this instance MyTable <> MYTABLE.

Got it?  Then maybe you can explain it to me.

Re:TQuery problem -- 'Table Does Not Exist'


Quote
liz...@expressway.com (Lizard) wrote:
>I am having a problem with TQuery, and I'm hoping someone can help me....
>I have a *very* basic query, a simple "select * from MyTable where Somefield=1".
>When I have 'LiveResult' set to false, the query works perfectly, returning
>precisely the data I wish. But when I set LiveResult to *true*, so I can edit
>rows, the query bombs, claiming 'The Table does not exist'. ARRRGHHHH! This
>occurs in both the runtime and design-time environments. The fact that the query
>works under some conditions leads me to conclude the fault, dear Brutus, lies
>not in our SQL, but in our VCL. :)
>I am using ODBC to talk to Oracle Workgroup Server running under Novell. All of
>my TTable components are getting their data without trouble.
>Thanks in advance for any help.
>Evolution Doesn't Take Prisoners:Lizard
>Cease then to fashion state-made sin,
>And give not your children cause to doubt
>That virtue springs from iron within --
>Not lead without:Kipling

I have had a similar problem with the Client Server Version of Delphi.
Try enclosing the schema.tablename in quotes eg. "VENDOR2.TABE1"
this usually works for me.

Other Threads