SELECT Bug with TkbmMemTable
Posted: Sat 12 Aug 2017 18:25
Howdy All!
If I
1) Create a simple TkbmMemTable with fields Enabled (Boolean) and RateCodeID (Integer),
2) Fill it with a single record with values Enabled = True,RateCodeID = 1,
3) Attach it to a TVirtualQuery, and issue the the following SQL statement:
SELECT Enabled FROM Test WHERE RateCodeID = 1
TVirtualQuery returns an empty data set.
4) If I use the TkbmMemTable's Locate() method, it finds the record. See sample test code below:
// Add SINGLE record
TestTable_->Insert();
TestTable_->FieldValues[L"Enabled"] = true;
TestTable_->FieldValues[L"RateCodeID"] = 1;
TestTable_->Post();
// Locate record
if (TestTable_->Locate(L"RateCodeID",1,TLocateOptions()) == false)
{
OutputDebugString(L"Locate failed!");
}
// See if TVirtualQuery can perform a SIMPLE SQL statement
VirtualQuery_->SQL->Text = L"SELECT Enabled FROM Test WHERE RateCodeID = 1";
VirtualQuery_->Open();
if (VirtualQuery_->IsEmpty() == true)
{
OutputDebugString(L"Test failed!");
}
All the best,
Aggie85
If I
1) Create a simple TkbmMemTable with fields Enabled (Boolean) and RateCodeID (Integer),
2) Fill it with a single record with values Enabled = True,RateCodeID = 1,
3) Attach it to a TVirtualQuery, and issue the the following SQL statement:
SELECT Enabled FROM Test WHERE RateCodeID = 1
TVirtualQuery returns an empty data set.
4) If I use the TkbmMemTable's Locate() method, it finds the record. See sample test code below:
// Add SINGLE record
TestTable_->Insert();
TestTable_->FieldValues[L"Enabled"] = true;
TestTable_->FieldValues[L"RateCodeID"] = 1;
TestTable_->Post();
// Locate record
if (TestTable_->Locate(L"RateCodeID",1,TLocateOptions()) == false)
{
OutputDebugString(L"Locate failed!");
}
// See if TVirtualQuery can perform a SIMPLE SQL statement
VirtualQuery_->SQL->Text = L"SELECT Enabled FROM Test WHERE RateCodeID = 1";
VirtualQuery_->Open();
if (VirtualQuery_->IsEmpty() == true)
{
OutputDebugString(L"Test failed!");
}
All the best,
Aggie85