I'm trying to learn how to use BEGIN ... COMMIT in SQLite. I'm trying this code:
BEGIN
INSERT INTO fields VALUES ('field1')
COMMIT;
but it fails with
Error: near "INSERT": syntax error
When using just the insert statement, it succeeds, though:
INSERT INTO fields VALUES ('field1');
Since you have it in a transaction you must end each statement with ;
BEGIN;
INSERT INTO fields VALUES ('field1');
COMMIT;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With