"SQL Query problems!!" 
Author Message
 "SQL Query problems!!"



Quote:
>How to select a "Table" (such as Table1: TTable) in delphi by SQL?

>Select * from "Table1"  <----- error, table1 not found!!!

>I used Table1 (with Cached updates) to open a  database file "Stock.db"  and
>I want to use SQL Query to sort out some records from Table1. Due to cached
>updates, the records in "Stock.db" may not be updated, so, I want to sort
>out the records form Table1 directory without updating the "Stock.DB".

You cannot. A TTable is a Delphi object, existing only in the memory space
of a Delphi application. The dataset it produces is also only accessible
within that same memory space. SQL, on the other hand, can only extract
data from an actual base table in a database. (For local table types, dBASE
and Paradox, a "database" is a directory on a drive.)

True, unapplied changes in a cache will not be seen as part of the table.
Such changes would only be part of the table when the changes are applied.
At that time, the change data is taken from the cache and put into the base
table. Unless data is actually in the base table, SQL would not see it.

//////////////////////////////////////////////////////////////////////////
Steve Koterski                 "Like a camel, I can go without a drink for
Technical Publications         seven days--and have on several horrible
INPRISE Corporation            occasions."
http://www.*-*-*.com/ ;                               -- Herb Caen



Wed, 18 Jun 1902 08:00:00 GMT  
 "SQL Query problems!!"
How to select a "Table" (such as Table1: TTable) in Delphi by SQL?

Select * from "Table1"  <----- error, table1 not found!!!

I used Table1 (with Cached updates) to open a  database file "Stock.db"  and
I want to use SQL Query to sort out some records from Table1. Due to cached
updates, the records in "Stock.db" may not be updated, so, I want to sort
out the records form Table1 directory without updating the "Stock.DB".

Any Suggestion?
Please Help
A Newbie in Delphi



Wed, 18 Jun 1902 08:00:00 GMT  
 "SQL Query problems!!"

Quote:
>How to select a "Table" (such as Table1: TTable) in Delphi by SQL?

>Select * from "Table1"  <----- error, table1 not found!!!

>I used Table1 (with Cached updates) to open a  database file "Stock.db"  and
>I want to use SQL Query to sort out some records from Table1. Due to cached
>updates, the records in "Stock.db" may not be updated, so, I want to sort
>out the records form Table1 directory without updating the "Stock.DB".

If the table name is not "Table1" in the database you are going to get table
not found errors.  If you want to select data from a table in a Sql statement
it has to be the real table name: "Select * from Stock"

HTH

********************************
Michael Glatz              


There are very few personal problems that cannot be solved through a suitable
application of high explosives.



Wed, 18 Jun 1902 08:00:00 GMT  
 "SQL Query problems!!"
On Tue, 16 Mar 1999 00:30:39 +0800, "Matthew LEE"

Quote:

>How to select a "Table" (such as Table1: TTable) in Delphi by SQL?

>Select * from "Table1"  <----- error, table1 not found!!!

Just SELECT * FROM STOCK WHERE .....

Jan Steiermark



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. The keys "-"/"+"/"*"

2. Permission problem with "insert" query

3. Problem with "group by" in query

4. SQL Server/Delphi/"SET" problem

5. ""256 Color Mouse""

6. MSSQL 6.5 "Query Canceled"

7. Parameterized queries and "\" (backslash)

8. "Parameter not set in query string"

9. Access: "Query too complex"

10. MS SQL Server "Connection in USE"

11. "Missing comma" error with SQL statement

12. Multiple "Like" in Local SQL

 

 
Powered by phpBB® Forum Software