TMemofield in XE4

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
jesika
Posts: 3
Joined: Mon 02 Dec 2013 12:14

TMemofield in XE4

Post by jesika » Mon 02 Dec 2013 12:26

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TMemofield in XE4

Post by AlexP » Tue 03 Dec 2013 11:03

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.

jesika
Posts: 3
Joined: Mon 02 Dec 2013 12:14

Re: TMemofield in XE4

Post by jesika » Tue 03 Dec 2013 17:44

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...

eurides.baptistella
Posts: 9
Joined: Wed 12 Dec 2012 19:36

Re: TMemofield in XE4

Post by eurides.baptistella » Thu 05 Dec 2013 11:11

I have the same problem!
Do we have any solution?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TMemofield in XE4

Post by AlexP » Fri 06 Dec 2013 11:52

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.

eurides.baptistella
Posts: 9
Joined: Wed 12 Dec 2012 19:36

Re: TMemofield in XE4

Post by eurides.baptistella » Fri 06 Dec 2013 13:35

Thank!
This parameter solved my problem.

jesika
Posts: 3
Joined: Mon 02 Dec 2013 12:14

Re: TMemofield in XE4

Post by jesika » Fri 06 Dec 2013 13:40

It worked. Thank you.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TMemofield in XE4

Post by AlexP » Mon 09 Dec 2013 07:12

Hello,

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

Post Reply