Re: [sqlite] C Code in a trigger supported in 3.3.x?

2006-01-25 Thread Russell Leighton


Solved. Bug in my code. Sorry for the alarm.

Russell Leighton wrote:



Update. I actually have 2 nearly identical triggers as described below.

One works, the other produces "shifted" output...it appears that the 
sqlite3_column_xxx() functions
are returning the wrong data when executing in this trigger. Calling 
the same function from outside the trigger

produces proper data.

Digging into it further...

Russell Leighton wrote:



This worked in 3.2.8 but not in 3.3.1/2 

I delcare a function using sqlite3_create_function()...this takes 1 
arg , an integer and calls the usual
code to execute a 'select[ based on the integer as a key and does 
some work based on the result.


I declare a temp trigger to call the above when certain columns are 
updated.


*When the trigger executes the result of th select is garbage.*

I call the same function outside the trigger and it works fine.

Is there some rule you cannot execute the code of the C API inside a 
trigger?


Thx

Russ









Re: [sqlite] C Code in a trigger supported in 3.3.x?

2006-01-24 Thread Russell Leighton


Update. I actually have 2 nearly identical triggers as described below.

One works, the other produces "shifted" output...it appears that the 
sqlite3_column_xxx() functions
are returning the wrong data when executing in this trigger. Calling the 
same function from outside the trigger

produces proper data.

Digging into it further...

Russell Leighton wrote:



This worked in 3.2.8 but not in 3.3.1/2 

I delcare a function using sqlite3_create_function()...this takes 1 
arg , an integer and calls the usual
code to execute a 'select[ based on the integer as a key and does some 
work based on the result.


I declare a temp trigger to call the above when certain columns are 
updated.


*When the trigger executes the result of th select is garbage.*

I call the same function outside the trigger and it works fine.

Is there some rule you cannot execute the code of the C API inside a 
trigger?


Thx

Russ





[sqlite] C Code in a trigger supported in 3.3.x?

2006-01-24 Thread Russell Leighton


This worked in 3.2.8 but not in 3.3.1/2 

I delcare a function using sqlite3_create_function()...this takes 1 arg 
, an integer and calls the usual
code to execute a 'select[ based on the integer as a key and does some 
work based on the result.


I declare a temp trigger to call the above when certain columns are updated.

*When the trigger executes the result of th select is garbage.*

I call the same function outside the trigger and it works fine.

Is there some rule you cannot execute the code of the C API inside a 
trigger?


Thx

Russ