0

Within HSQLDB, I'm trying to create a stored procedure that executes a commit after having updated the database.

Something like: CREATE PROCEDURE MY_PROC(IN p_id INTEGER) MODIFIES SQL DATA BEGIN ATOMIC ... UPDATE ... ... COMMIT; END

Creating this procedure, by means of a call to the JDBC Statement.execute() method, I get an error: SQLSyntaxErrorException: unexpected token: COMMIT required: END

Without the COMMIT statement, the procedure is compiled correctly.

Any idea what I'm doing wrong?

1 Answer 1

0

You cannot commit the transaction inside a procedure.

You can commit after calling the procedure.

Sign up to request clarification or add additional context in comments.

1 Comment

That's what I was afraid of. Thanks anyway

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.