Page 1 of 1

[SQLite3] User Defined functions - not an error

Posted: Wed 06 Jul 2011 12:22
by MamProblem
Hi!

I use UniDAC 3.70.0.18 , RAD STUDIO C++ BUILDER XE and SQLite3 ver. 3.7.7.1

After executing my UDF function I get an sqlite3 error: "not an error.", but when I use previous version of sqlite3 (3.7.6) everything is ok. Example:

Code: Select all

double __fastcall Netto(double br,double v)   // oblicza Netto z brutto i vat
{
    if((double((100 * br)/(100+v)*100)/100) != NULL)
       return double((100 * br)/(100+v)*100)/100;
    else
       return 0;
}
...
Variant __fastcall __NETTO(Variant *Vect, const int ivSize)
{
   return Variant(Netto(Vect[0],Vect[1]));
}
...
void __fastcall TdMod::ConnectionAfterConnect(TObject *Sender)
{
     TLiteUtils::RegisterFunction(Connection,"_NETTO",2,__NETTO);
     ...
}
And then after executing : SELECT _NETTO(100,23); I get this error :/
Can You help me?

Posted: Thu 07 Jul 2011 07:14
by AlexP
Hello,

Thank you for the information, we have reproduced the problem.
It seems that this problem is connected with the new version of SQLite, because some SQLite functions return wrong result instead of the standard SQLITE_OK even after successful execution.
We will inform you when we solve this problem.

Posted: Fri 22 Jul 2011 07:55
by MamProblem
UniDAC 3.70.0.19 Fixed this problem. Thanks :)

Posted: Fri 22 Jul 2011 08:03
by AlexP
Hello,

Thank you for your confirmation. If any other questions come up, please contact us.