When I create trigger by giving select sp_dosomethingfunc(); THE
TRIGGER IS GETTING CREATED without any errors stmts within main r
executed, but stmts within this custom function-
sp_dosomethingfunc(sqlite3_context *context, int argc,sqlite3_value
**argv)-- r not excuted. Also what is that
sqlite3_context *context doing here? Y is it used?
I want to make use of exec within this custom function. How shall I use
it?
Awaiting reply.
-Original Message-
From: Jay Sprenkle [mailto:[EMAIL PROTECTED]
Sent: Friday, March 24, 2006 8:18 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] no errors,but not executed: Stored procedures in
triggers
On 3/24/06, Chethana, Rao (IE10) [EMAIL PROTECTED] wrote:
My problem is not with cascading or using recursive triggers.
Actually,
I am using sqlite3_create_function to execute some queries(like
insert or update etc.) but the control does not pass to the custom
function at all, ie., say a user-defined function
sp_dosomethingfunc(sqlite3_context *context, int argc,sqlite3_value
**argv)
{
Do something or execute some queries...
..etc
}
/* from main() I'm calling the above function using
sqlite3_create_function*/
int main()
{
/* after using sqlite_open */
sqlite3_create_function()
/* exec function is executed, but control is
not passed to sp_dosomethingfunc, how do I make stmts inside this
custom
function get executed? */
sqlite3_exec(.)
}
/* and this sp_dosomethingfunc, I'm calling from triggers. I'm not
getting any error. But this function is not executed */
your function would be executed by something like
select sp_dosomethingfunc
Since it's a function you have to do something to evaluate it.
Since your trigger is 'calling' the function, are you sure your
trigger is being run?