[SQLite3] User Defined functions - not an error

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MamProblem
Posts: 13
Joined: Mon 09 May 2011 11:11

[SQLite3] User Defined functions - not an error

Post by MamProblem » Wed 06 Jul 2011 12:22

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?

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

Post by AlexP » Thu 07 Jul 2011 07:14

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.

MamProblem
Posts: 13
Joined: Mon 09 May 2011 11:11

Post by MamProblem » Fri 22 Jul 2011 07:55

UniDAC 3.70.0.19 Fixed this problem. Thanks :)

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

Post by AlexP » Fri 22 Jul 2011 08:03

Hello,

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

Post Reply