I have been able to execute this locally with wrangler, but couldn't make this work in my code: ```

I have been able to execute this locally with wrangler, but couldn't make this work in my code:
BEGIN TRANSACTION;

INSERT INTO user (email, name) VALUES ("my@email.com", "name");
SELECT last_insert_rowid() INTO @lastUserId;
INSERT INTO oauth (provider, user_id) VALUES ("google", @lastUserId);
COMMIT;

SELECT @lastUserID

I got this error
A prepared SQL statement must contain only one statement
. It's a useful kind of query that avoid one round trip.
Was this page helpful?