[PostgreSQL] String concatenation result is memo

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Thomas J.
Posts: 95
Joined: Mon 21 Nov 2005 12:16
Location: Germany

[PostgreSQL] String concatenation result is memo

Post by Thomas J. » Fri 09 Jan 2009 14:11

Hello support,

SELECT *, c_name || ', ' || c_vorname AS Name FROM t_user

c_name and c_vorname is type STRING and result is with TUniQuery MEMO. :shock:

Thanks for your help
Thomas

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 12 Jan 2009 09:03

PostgreSQL server returns VARCHAR field with undefined length in such case. TStringField requires setting its Size property. So we don't use TStringField, and use TMemoField.

You can set the UnknownAsString option in SpecificOptions to True. In this case UniDAC creates TStringField with fixed size 8192 for such fields.

Thomas J.
Posts: 95
Joined: Mon 21 Nov 2005 12:16
Location: Germany

Post by Thomas J. » Mon 12 Jan 2009 10:34

Sorry but also this is not working.
I set the parameter to true and open the dataset. But in your data editor is for all rows (MEMO) and no sting.
Also at runtime the same problem.

Thanks for your help
Thomas

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 13 Jan 2009 09:07

PostgreSQL returns fields of type TEXT for your query which is always mapped on TMemoField.

You should change your query like the following:

Code: Select all

SELECT *, (c_name || ', ' || c_vorname)::varchar(100) AS Name FROM t_user

Post Reply