[sqlite] Problem with sqlite3_create_function

2016-01-20 Thread Bart Smissaert
Just to let you know that I have this all sorted now and that the problem was the fact that sqlite3.dll (the Windows dll) is compiled with the cdecl convention, which is a problem with callbacks back to a VB6 ActiveX dll as that expects std_call convention. Once I compiled sqlite3.dll with

[sqlite] Problem with sqlite3_create_function

2015-11-04 Thread Bart Smissaert
Is there something wrong or is there something missing from this sequence of SQLite actions? Note that all the return values are checked and are fine: sqlite3_open_v2 sqlite3_create_function sqlite3_prepare16_v2 run in loop till SQLITE_DONE: sqlite3_step(lStatementHandle) sqlite3_step will run

[sqlite] Problem with sqlite3_create_function

2015-11-04 Thread Bart Smissaert
Yes, I didn't think there was a bug in SQLite here, but just wanted some confirmation. Thanks for that. I suppose the only way to get to the bottom of this is to run sqlite3.dll, compiled with SQLITE_DEBUG and SQLITE_MEMDEBUG enabled and look at the log/trace. RBS On Wed, Nov 4, 2015 at 7:42

[sqlite] Problem with sqlite3_create_function

2015-11-04 Thread Bart Smissaert
Been trying to get to the bottom of this, but no success. Note that with one UDF in the statement all runs perfectly fine. Could somebody confirm that they can run 2 UDF's (I have mainly tried with the 2 the same UDF's) in the same SQL and that all runs as how it should? Just to make sure there is

[sqlite] Problem with sqlite3_create_function

2015-11-04 Thread Richard Hipp
On 11/4/15, Bart Smissaert wrote: > Been trying to get to the bottom of this, but no success. > Note that with one UDF in the statement all runs perfectly fine. > Could somebody confirm that they can run 2 UDF's (I have mainly tried with > the 2 the same UDF's) in the same SQL and that all > runs

[sqlite] Problem with sqlite3_create_function

2015-10-22 Thread Bart Smissaert
> Maybe running under control of a debugger would help to locate the exact error position I am not familiar with C code or C debugging, but will look into that. RBS On Thu, Oct 22, 2015 at 3:11 PM, Hick Gunter wrote: > > > >> Can you reproduce the problem using the sqlite shell? > >This won't

[sqlite] Problem with sqlite3_create_function

2015-10-22 Thread Bart Smissaert
received as the first parameter. > > -Urspr?ngliche Nachricht- > Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto: > sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Bart > Smissaert > Gesendet: Mittwoch, 21. Oktober 2015 00:31 > An: General Discussion

[sqlite] Problem with sqlite3_create_function

2015-10-22 Thread Hick Gunter
>> Can you reproduce the problem using the sqlite shell? >This won't be easy as the UDF is in an ActiveX dll, not in sqlite3.dlll > >This is the output from explain, run on this SQL: >SELECT XXX(F1, F2) as A, XXX(F1, F2) as B FROM UDF_TEST limit 3 XXX will just >add the results of the integer

[sqlite] Problem with sqlite3_create_function

2015-10-21 Thread Hick Gunter
21. Oktober 2015 00:31 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Problem with sqlite3_create_function Could somebody tell me what happens after the callback function (to do with sqlite3_create_function) has run, so after it has finished processing one row? Does it return to the c

[sqlite] Problem with sqlite3_create_function

2015-10-21 Thread Bart Smissaert
richt- >> Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto: >> sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Bart >> Smissaert >> Gesendet: Montag, 19. Oktober 2015 13:49 >> An: General Discussion of SQLite Database >> Betreff

[sqlite] Problem with sqlite3_create_function

2015-10-19 Thread Bart Smissaert
issaert > Gesendet: Montag, 19. Oktober 2015 13:49 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] Problem with sqlite3_create_function > > Still getting a crash here if I use the UDF more than once in the same > statement: > > So, table wi

[sqlite] Problem with sqlite3_create_function

2015-10-19 Thread Bart Smissaert
Still getting a crash here if I use the UDF more than once in the same statement: So, table with 2 integer columns and then doing: select XXX(field1), XXX(field2) from table1 causes a crash. I can see that the statement prepares fine and that the UDF gets called twice (for the first row), but

[sqlite] Problem with sqlite3_create_function

2015-10-19 Thread Hick Gunter
dresses? -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Bart Smissaert Gesendet: Montag, 19. Oktober 2015 13:49 An: General Discussion of SQLite Database Betreff:

[sqlite] Problem with sqlite3_create_function

2015-10-19 Thread Bart Smissaert
Actually, I can see now that the result of sqlite3_extended_errcode(lDBHandle) is in fact the same as the result of sqlite3_step as I get for the 3 rows 100, 100, 100, 101 so SQLITE_ROW 3 times then SQLITE_DONE. Note sure though why this is and why I get unknown error as a result of

[sqlite] Problem with sqlite3_create_function

2015-10-19 Thread Bart Smissaert
Some progress with this. Still get an error: unknown error, Extended error code: 100, but it all runs and get the right results and no crash. Problem was I did put the result of sqlite3_step in a VB Long datatype: Dim lStepResult As Long lStepResult = sqlite3_step(lStatementHandle) Now I do

[sqlite] Problem with sqlite3_create_function

2015-10-18 Thread Bart Smissaert
> Is that binary ? Or hex ? Normal decimal, it is the result of sqlite3_extended_errcode(lDBHandle) > Just to verify, can you download the SQLite shell tool and try to execute the same sequence ? Not sure that is that simple as the code to produce the result is in an ActiveX dll, not in

[sqlite] Problem with sqlite3_create_function

2015-10-18 Thread Simon Slavin
On 18 Oct 2015, at 8:35pm, Bart Smissaert wrote: > I get an error: unknown error, Extended error code: 100. Is that binary ? Or hex ? > I do understand that most likely the problem is somewhere in my VB6 code, > but I can't see it and maybe somebody can shed some light on this from the >

[sqlite] Problem with sqlite3_create_function

2015-10-18 Thread Bart Smissaert
Using the latest SQLite, 3.9.1, running on Windows 7. Created a simple SQLite UDF with sqlite3_create_function and that function only sets the result as a fixed integer value, 123. The function is registered fine, so no error. I call this function XXX. Have a table like this: CREATE TABLE