Page 1 of 1

Problems with null values (Advantage Database with unicode)

Posted: Wed 16 Mar 2011 13:03
by shsit
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

Posted: Wed 16 Mar 2011 14:05
by AlexP
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.

Posted: Wed 16 Mar 2011 16:59
by shsit
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.

Posted: Thu 17 Mar 2011 08:17
by AlexP
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.

Posted: Thu 17 Mar 2011 10:41
by shsit
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...

Posted: Thu 17 Mar 2011 13:26
by AlexP
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