Hi,
i have problem with CAST expression AS type commend. I use TZQuery and i want to get TStringField fileds from column (type - text).
So i try:
SELECT
CAST (vname AS varchar(100)),CAST(vvalue AS varchar(100)), id
FROM schemat.baza WHERE vname ~* :var_name ORDER BY vname,id
and i get :
vname - TStringField
vvalue - TMemoField
id - TIntegerField
why vvalue isn't TStringField?
When i use:
SELECT
id,CAST (vname AS varchar(100)),CAST(vvalue AS varchar(100))
FROM schemat.baza WHERE vname ~* :var_name ORDER BY vname,id
where id is on the first place i get :
id - TIntegerField
vname - TMemoField
vvalue - TMemoField
Any ideas?
Zeos + Postgresql + D2005
Moderators: gto, EgonHugeist
we don't need it i solved that problem.
in table declaration is:
(
id serial NOT NULL,
vname text,
vvalue text,
CONSTRAINT pk_eknr_cfg PRIMARY KEY (id)
)
but the solution is:
SELECT
CAST (vname AS varchar(100)) AS vname,CAST(vvalue AS varchar(100)) AS vvalue, id
FROM schemat.baza WHERE vname ~* :var_name ORDER BY vname,id
In BDE it wasn't problem when i used CAST without new column name. But in that situation (zeos) it seems to be important.
in table declaration is:
(
id serial NOT NULL,
vname text,
vvalue text,
CONSTRAINT pk_eknr_cfg PRIMARY KEY (id)
)
but the solution is:
SELECT
CAST (vname AS varchar(100)) AS vname,CAST(vvalue AS varchar(100)) AS vvalue, id
FROM schemat.baza WHERE vname ~* :var_name ORDER BY vname,id
In BDE it wasn't problem when i used CAST without new column name. But in that situation (zeos) it seems to be important.