Hi,

 

Sorry, but I couldn't quite parse how to use the raise-function in a
SQLite3 trigger, from the documentation at
http://www.sqlite.org/lang_createtrigger.html.  How exactly do I do
this?  I ask because the docs generally seem to indicate that raise() is
an "expression" (http://www.sqlite.org/lang_expr.html), it seems that
expr only appears in a CREATE TRIGGER statement in its WHEN clause (if
it has one).  What I'm after is using raise() in the "trigger-program",
which is where the docs say it may be used.  Something like this:

 

CREATE TRIGGER <trigger-name> AFTER INSERT on <table-name> WHEN EXISTS
(select * from <some-table>)

BEGIN

                RAISE(ROLLBACK);

END

 

Where the argument to the WHEN EXISTS clause is just whatever query
determines if the trigger should fire.  When I submit this to SQLite, it
says there's a syntax error near one of the parentheses.  If I replace
the call to RAISE() with, say, an update statement, it parses fine.

 

As is sometimes the case, the answer probably is obvious and staring me
in the face, but I just haven't quite gotten it yet.  Any help is
appreciated.  Thanks!

 

Best,

David

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to