Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FireDac reading Null Memo type fields as Empty Strings



Permlink Replies: 4 - Last Post: Dec 12, 2017 10:30 AM Last Post By: Hector Stivalet Threads: [ Previous | Next ]
Hector Stivalet

Posts: 3
Registered: 12/23/17
FireDac reading Null Memo type fields as Empty Strings
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2017 8:37 AM
Hi community,

Using Embarcadero Delphi X7, I'm trying to migrate a massive DB from SQL Server 2014 to PostgreSQL 10.

I'm having issues only with the Memo type fields (defined as Varchar(max) in SQL SERVER and as TEXT in Postgres).

When I have NULL values of this type, my FDQueryReader interprets the source as an empty string. At this point FDQueryReader.Fields[x].DataType is equal to ftMemo and the value is ''.

On my destination, my writer is able to insert nulls but in this case is inserting empty string that was read from the source.

I need the data to be equal in both DB managers for this migration. I have tried using FDBatchMove but is doing the same.

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDac reading Null Memo type fields as Empty Strings
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2017 9:21 AM   in response to: Hector Stivalet in response to: Hector Stivalet
Not sure, but something like that was fixed in RAD Studio DX10.2 Tokyo. You can try it and see if it works for you.

--
With best regards,
Dmitry
Hector Stivalet

Posts: 3
Registered: 12/23/17
Re: FireDac reading Null Memo type fields as Empty Strings
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2017 9:44 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Thanks a lot Mr Arefiev,

I can't update my version right now but at least I know this is not configuration wise issue. I'll see if I can solve this issue analyzing the component behavior.

Best Regards.
Antonio Estevez

Posts: 665
Registered: 4/12/00
Re: FireDac reading Null Memo type fields as Empty Strings
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2017 9:57 AM   in response to: Hector Stivalet in response to: Hector Stivalet
El 12/12/2017 a las 17:37, Hector Stivalet escribió:
Hi community,

Using Embarcadero Delphi X7, I'm trying to migrate a massive DB from SQL Server 2014 to PostgreSQL 10.

I'm having issues only with the Memo type fields (defined as Varchar(max) in SQL SERVER and as TEXT in Postgres).

When I have NULL values of this type, my FDQueryReader interprets the source as an empty string. At this point FDQueryReader.Fields[x].DataType is equal to ftMemo and the value is ''.

You can use FDQueryReader.Fields[x].IsNull to check if the Memo is null

Hector Stivalet

Posts: 3
Registered: 12/23/17
Re: FireDac reading Null Memo type fields as Empty Strings
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2017 10:30 AM   in response to: Antonio Estevez in response to: Antonio Estevez
Thanks for the advice Mr. Antonio Estevez,

Testing the condition FDQueryReader.Fields[x].IsNull returns true for:
1. null records
2. empty strings records

So this condition doesn't solves my issue, now I have the opposite behavior I'm looking for. It's working the same as setting true: EmptyStr2Null, some memo fields are originally meant to be empty strings and some tables in this DB have constraints for nulls in Memo records.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02