Reputation: 641
I want to create a update trigger,
can I create a variable betweent "BEGIN" and "END" , and set value by query from a select sql statement ?? And then execute "if" "else" statement by judging this variable
Upvotes: 6
Views: 2576
Reputation: 31
you can create temporary tables with a single row instead of variables, and cross join with them in the rest of the trigger statements, using where
clauses instead of if
statements
Upvotes: 0
Reputation: 180270
As an embedded database, SQLite is designed to be used directly from another programming language, so it does not have programming constructs like variables or IF
statements.
If it is not possible to implement your logic with the trigger's WHEN
clause or subqueries, you have to do this in Java (i.e., without a trigger).
Upvotes: 4