Page 1 of 1

TMemofield in XE4

Posted: Mon 02 Dec 2013 12:26
by jesika
Good day.
I wonder why, using the drive in PostgreSQL in Delphi XE4, the following select returns a Memo:

"SELECT COALESCE('AVC', '') FROM PG_DATABASE"

or with cast:

"SELECT CAST(COALESCE(CAST('AVC' AS VARCHAR(30)), '') AS VARCHAR(30)) FROM PG_DATABASE"

Recalling that in Firebird, the return is a String.
Have any way to return a String in PostgreSQL?

Thanks.

Re: TMemofield in XE4

Posted: Tue 03 Dec 2013 11:03
by AlexP
Hello,

We cannot reproduce the problem on XE4 and the latest driver version 3.3.4. When explicitly mapping fields with the CAST method, the fields are mapped as TWideString. If you are using the previous versions of the driver, please try reproducing the problem on the latest driver version - if the problem repeats, please send a small sample reproducing the problem, and also specify the exact version of the PostgreSQL server.

Re: TMemofield in XE4

Posted: Tue 03 Dec 2013 17:44
by jesika
Hello.
I updated the driver but still the problem occurs. The PostgreSQL version is 8.2.4.
Below link to download the sample project:
http://www.4shared.com/rar/HgKzzAaO/Teste_PGS.html

I tested version 9.2 and it works correctly, but it is necessary to work in version 8.2.4 because there is no possibility to migrate.
Thanks...

Re: TMemofield in XE4

Posted: Thu 05 Dec 2013 11:11
by eurides.baptistella
I have the same problem!
Do we have any solution?

Re: TMemofield in XE4

Posted: Fri 06 Dec 2013 11:52
by AlexP
Hello,

Such behaviour is due to that server doesn't send such field size, and if a string field ha no size, we map it to a Memo field. To solve the problem, you should enable the UnknownAsString option.

Re: TMemofield in XE4

Posted: Fri 06 Dec 2013 13:35
by eurides.baptistella
Thank!
This parameter solved my problem.

Re: TMemofield in XE4

Posted: Fri 06 Dec 2013 13:40
by jesika
It worked. Thank you.

Re: TMemofield in XE4

Posted: Mon 09 Dec 2013 07:12
by AlexP
Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.