Delphi: problem with Paradox DB field name (spaces in the field name)

I have a paradoxical table from an old system in which I need to run one query. Field names have spaces in them, i.e. "Street 1". When I try to formulate a query in delphi only for the "Street 1" field, I get an error message - Invalid keyword use. Token: 1, line number: 1

Delphi V7 - pascal object, standard query for the name of the TQUery1 object.

+6
sql delphi tquery paradox
source share
4 answers

You need a string prefix with the table name in the query.

For example: the field name is "street 1", the table is called clients:

SELECT customers."Street 1" FROM customers WHERE ... 
+8
source share

Usually you need to specify the field name in this case. For example:

select * from t1, where "street 1" = "test";

I tried this on the paradox 7 table and it worked. If this does not help, can you post the query you are trying to use? It would be easier to help with this information.

+2
source share

I only need street information from the address data stored in the customer table. I can make it work fine if I make SELECT * FROM clients, however this is a very large table and gives numerous results. If I make a SELECT "Street 1" FROM the clients, the output will be "Street 1" in each returned record, that is, it will not return the actual data. This should be due to the use of "

thanks for the help

Joe

0
source share

I think you should use [and] instead of ":

 SELECT customers.[Street 1] FROM customers WHERE ... 
-one
source share

All Articles