I have below piece of code to run a user defined function which will take up a variable created at triggering the trigger.
As there is no option to create a variable i used following technique(Declare variable in sqlite and use it) to create a variable and pass it on to my function.
But i get below error
Traceback (most recent call last):
File "C:\sqlite\DBTesting2.py", line 18, in <module>
END;""")
OperationalError: near "PRAGMA": syntax error
Following is my code for the trigger
cur.execute("""CREATE TRIGGER simpleTrigger1
AFTER INSERT ON summary
BEGIN
PRAGMA temp_store = 2;
CREATE TEMP TABLE _Variables(variablename, value);
INSERT INTO _Variables (variablename) VALUES ('data');
UPDATE _Variables SET value=cu.fetchone() WHERE variablename='data';
SELECT hellofunc(value) FROM _Variables WHERE variablename='data';
DROP TABLE _Variables;
END;""")
Please help me with this. Is there anything I am missing?
Thanks in advance.