Board index » delphi » paradox query problem ...

paradox query problem ...

I have to extract data from tables with the columns names  'VALUE' and
'DESC'. When I try to do :

select VALUE from mytable    or
select DESC from mytable

I get an sql error both with Delphi or Sql Explorer

I try to do a "select * from mytable" and get data in a TclientDataset
, it works  but , when I try to filter this dataset I can't get the
data with filter  "VALUE = ''     "
because Tclientdataset don't know a filter like  "VALUE IS NULL"

I don't know how to get the null value of my column "VALUE" ...

help me thanks

 

Re:paradox query problem ...


Both VALUE and DESC are SQL keywords and illegal to use a field names.
Quote
belspar wrote in message ...
>I have to extract data from tables with the columns names  'VALUE' and
>'DESC'. When I try to do :

>select VALUE from mytable    or
>select DESC from mytable

>I get an sql error both with Delphi or Sql Explorer

>I try to do a "select * from mytable" and get data in a TclientDataset
>, it works  but , when I try to filter this dataset I can't get the
>data with filter  "VALUE = ''     "
>because Tclientdataset don't know a filter like  "VALUE IS NULL"

>I don't know how to get the null value of my column "VALUE" ...

>help me thanks

Re:paradox query problem ...


On Wed, 15 Nov 2000 08:38:40 -0700, "Todd" <TMel...@MyRealBox.com>
wrote:

Quote
>Both VALUE and DESC are SQL keywords and illegal to use a field names.

use double quotes:
SELECT "VALUE", "DESC" FROM "Tablename.db"
if mytable is a string variable that evaluates to "Tablename.db" then
it is OK.

HTH,
Dan

Quote

>belspar wrote in message ...
>>I have to extract data from tables with the columns names  'VALUE' and
>>'DESC'. When I try to do :

>>select VALUE from mytable    or
>>select DESC from mytable

>>I get an sql error both with Delphi or Sql Explorer

>>I try to do a "select * from mytable" and get data in a TclientDataset
>>, it works  but , when I try to filter this dataset I can't get the
>>data with filter  "VALUE = ''     "
>>because Tclientdataset don't know a filter like  "VALUE IS NULL"

>>I don't know how to get the null value of my column "VALUE" ...

>>help me thanks

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control:
visit us at www.cmdcsystems.com
[SPAM block: change at to @ in my e-mail address]

Re:paradox query problem ...


LeWed, 15 Nov 2000 19:00:55 GMT, D...@CMDCsystems.com (Dan Brennand) a
crit :

Quote
>On Wed, 15 Nov 2000 08:38:40 -0700, "Todd" <TMel...@MyRealBox.com>
>wrote:

>>Both VALUE and DESC are SQL keywords and illegal to use a field names.

I know that , but ...

Quote
>use double quotes:
>SELECT "VALUE", "DESC" FROM "Tablename.db"
>if mytable is a string variable that evaluates to "Tablename.db" then
>it is OK.

(When I see my querry.active  to true without error , I idolize you as
a god , but , when I see result in a dbgrid ... )

this request allow me to retrieve 1500 row with  only 2 values
1 | "VALUE" | "DESC " |
2 | "VALUE" | "DESC " |
3 | "VALUE" | "DESC " |
4 | "VALUE" | "DESC " |
5 | "VALUE" | "DESC " |
6 | "VALUE" | "DESC " |
7 | "VALUE" | "DESC " |
8 | "VALUE" | "DESC " |
... ... ...

that's not a good solution isn't it ?

Re:paradox query problem ...


Quote
>this request allow me to retrieve 1500 row with  only 2 values
>1 | "VALUE" | "DESC " |
>2 | "VALUE" | "DESC " |
>3 | "VALUE" | "DESC " |
>4 | "VALUE" | "DESC " |
>5 | "VALUE" | "DESC " |
>6 | "VALUE" | "DESC " |
>7 | "VALUE" | "DESC " |
>8 | "VALUE" | "DESC " |
>... ... ...

>that's not a good solution isn't it ?

Probably not ;)
What is your table structure?
Which columns do you want to see in the grid?
How many records (rows) does it have?
Do you have a WHERE clause to limit the information returned?

Dan

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control:
visit us at www.cmdcsystems.com
[SPAM block: change at to @ in my e-mail address]

Other Threads