i have query that counting records with and without null values. if i post this query directly to mysql (using phpmyadmin) the result is one row and two columns with right numbers. But if a do it in C++ Builder the result is one row and two columns but the first column is type String and Value is "\x03" and second column type is String and Value is "\x02". Right values is Integer with value 3 and Integer with value 2.
thanks for your help
Code: Select all
qryCommand->Close();
qryCommand->SQL->Clear();
qryCommand->SQL->Add("SELECT COUNT( pmc.id ) AS pocetPmc, COUNT( pm.id ) AS pocetPm FROM product_metadata_category AS pmc LEFT OUTER JOIN product_metadata AS pm ON pmc.id = pm.id_metadata_category WHERE pmc.id_category = :idCategory");
qryCommand->ParamByName("idCategory")->AsInteger = qryCategory->FieldByName("id")->AsInteger;
qryCommand->Open();
bool hasProductAttributes_AllOK = false;
if ( !qryCommand->Eof )
{
if ( qryCommand->FieldByName("pocetPmc")->AsInteger == qryCommand->FieldByName("pocetPm")->AsInteger )
hasProductAttributes_AllOK = true;
} // end if
qryCommand->Close();