DBgrid lazarus / 16-Databases ---------------------------------------------------------------------- cpalx · 2009-06-17 18:32 Hello, i am using Lazarus 0.97 (2009-6-16) on windows XP SP3, i have Zeosbb installed to connect to PostgreSQL 8.3 version. It is working almost perfect, but this query select fieldone || fieldtwo as data, field2,field3 from aTable when i use dbgrid to show, it displays (memo) instead of the real data. Others fields display ok how can i use that query and display good in the dbgrid ---------------------------------------------------------------------- audio2 · 2009-06-17 19:32 I had a similar problem with a sqlite database all text fields where displaying as (MEMO), it was fixed by changing the text fields to VARCHAR fields. Then everything displayed fine. Don't know if this applies to PostgreSQL but it worked with Sqlite hope this helps audio2 ---------------------------------------------------------------------- cpalx · 2009-06-17 19:45 if you refer to database field (in postgres), my fields are varchar, when i display ine by one it dispplay correctly but when i join them ( || ) then display (memo) thanks for you replay ---------------------------------------------------------------------- Marc · 2009-06-17 21:48 the reason is that concatinated varchars are seen as one big varchar with size (iirc) > 255. if your fields are shorter, use a cast: (field1 || field2)::varchar(sum_of_length_of_both_fields_or enything_else_you_like) ---------------------------------------------------------------------- cpalx · 2009-06-18 03:17 thanks, i solved it select cast ( field1 || field2 as varchar) from table thanks a lot. ---------------------------------------------------------------------- tatamata · 2009-06-18 09:46 Yes, Use only Varchar for strings in PostgreSQL.