Delphi: Paradox DB Field Name Issue (Spaces in field name)

后端 未结 4 606
悲哀的现实
悲哀的现实 2020-12-20 18:44

I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. \"Street 1\". When I try and formulate a query in d

相关标签:
4条回答
  • 2020-12-20 19:01

    You normally need to quote the field name in this case. For example:

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

    I tried this on a paradox 7 table and it worked. If that doesn't help, can you post the query you are trying to use? It would be easier to help with that info.

    0 讨论(0)
  • 2020-12-20 19:04

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

    SELECT customers.[Street 1] FROM customers WHERE ...
    
    0 讨论(0)
  • 2020-12-20 19:14

    I only need the street information from the address details held in the customer table. I can get it to work fine if I do a SELECT * FROM customers, however this is a very large table and returns numerous results. If I do SELECT "Street 1" FROM customers, the output is "Street 1" in every record returned - i.e. it does not return the actual data. It must be something to do with the use of "

    Thanks for your help

    Joe

    0 讨论(0)
  • 2020-12-20 19:15

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

    For example: field name is 'Street 1', table is called customers the select is:

    SELECT customers."Street 1" FROM customers WHERE ...
    
    0 讨论(0)
提交回复
热议问题