SQLite + Blobfield + 'IsNull'

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tl.cp
Posts: 1
Joined: Fri 10 Apr 2015 21:11

SQLite + Blobfield + 'IsNull'

Post by tl.cp » Fri 10 Apr 2015 21:35

I'm using XE7 C++ and UniDAC. At time i changed from FireDac to UniDac in all my projects.
With Oracle und MySql all works perfect (over 10 times faster than FireDac!).
Now i changed the parts with SQLite. I have following problem with blobfields:

if(!qu->FieldByName(sFeldName)->IsNull){
i++;
}

I got for all fields: is not Null !
(with FireDac i got the correct answer)
I tested this at time with windows.

Please check this.

regards from germany

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

Re: SQLite + Blobfield + 'IsNull'

Post by AlexP » Tue 14 Apr 2015 08:02

Hello,

We can't reproduce the problem on the latest UniDAC version, the IsNull property of UniQuery returns correct values for Null fields. Please modify the following code, so that the problem is reproduced and send it back to us.

Code: Select all

{
	UniConnection1->ProviderName = L"SQLite";
	UniConnection1->Database = L":memory:";
	UniConnection1->Connect();
	UniConnection1->ExecSQL(L"CREATE TABLE [T_TEST]([F_ID] INTEGER PRIMARY KEY,	[F_BLOB] BLOB);");
	UniConnection1->ExecSQL(L"INSERT INTO T_TEST(F_ID, F_BLOB) VALUES(1, 'test')"); //Not Null
	UniConnection1->ExecSQL(L"INSERT INTO T_TEST(F_ID) VALUES(2)"); //Null
	UniQuery1->SQL->Text = L"SELECT * FROM T_TEST";
	UniQuery1->Open();
	while (!UniQuery1->Eof)
	{
		if (UniQuery1->FieldByName(L"F_BLOB")->IsNull)
		{
			ShowMessage(UniQuery1->FieldByName(L"F_ID")->AsString); // 2
		}
		UniQuery1->Next();
	}
}

Post Reply