Page 1 of 1

SQLite + Blobfield + 'IsNull'

Posted: Fri 10 Apr 2015 21:35
by tl.cp
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

Re: SQLite + Blobfield + 'IsNull'

Posted: Tue 14 Apr 2015 08:02
by AlexP
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();
	}
}