Problems with null values (Advantage Database with unicode)

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
shsit
Posts: 21
Joined: Thu 05 Oct 2006 11:41

Problems with null values (Advantage Database with unicode)

Post by shsit » Wed 16 Mar 2011 13:03

Hi,

I have a strange problem and can't find a reason for it.

I have a UniConnection and an UniQuery.
The statement of the UniQuery is something like that:

Code: Select all

SELECT IC_Nachrichten.id, IC_Prioritaeten.Bezeichnung AS Prioritaet
FROM IC_Nachrichten
LEFT JOIN IC_Prioritaeten ON IC_Prioritaeten.ID = IC_Nachrichten.ID_IC_Prioritaeten 
WHERE ID_Personal_von = 2
The query gives back the "ID" and the "Bezeichnung". The value of "Bezeichnung" is null since there's no entry in the table IC_Nachrichten.

The strange problem:
When I output the value of the field "Bezeichnung" it gives me some strange character instead of an empty string.

procedure TForm1.Button1Click(Sender: TObject);
begin
UniQuery1.Open;
showmessage(UniQuery1Prioritaet.AsString); // outputs somethins like "Ұ", but the value is definetly "null"
UniQuery1.Close;
end;

The UniConnection is set to unicode, and the fields of the database tables are defined as nVarChar fields.


I could provide you a sample application + sample database to reproduce this problem.

Thank you very much for you help!


System information:
Delphi 2009
UniDac version 3.50.0.13
Sybase Advantage Database Server 10.10

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

Post by AlexP » Wed 16 Mar 2011 14:05

Hello,

I could not reproduce the problem.
Please send a complete small sample to alexp*devart*com to demonstrate it including a script to create and fill a table.

shsit
Posts: 21
Joined: Thu 05 Oct 2006 11:41

Post by shsit » Wed 16 Mar 2011 16:59

Hi Alex,

I've solved the problem by updating the ADS Server (and ODBC driver + ADS Delphi components) from 10.03 to 10.1.

I'm sorry for steeling your time, but I didn't expected that this is the cause for the strange behaviour.

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

Post by AlexP » Thu 17 Mar 2011 08:17

Hello,

It is good to see that this problem was solved.

But it's really strange behavior of the ADS server, because I have tested the problem exactly on ADS 10.0.0.3, and all works fine.

shsit
Posts: 21
Joined: Thu 05 Oct 2006 11:41

Post by shsit » Thu 17 Mar 2011 10:41

Hi,

hmmm, thats really wired.
I would like to investigate this a bit more, but I don't have the time at the moment - spend some hours for this issue and now I have to do some work...

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

Post by AlexP » Thu 17 Mar 2011 13:26

Hello,

If you have some free time, please send a small sample including a script to create and fill tables so that I am able to test the situation

Post Reply