Executes a SQL statement, returning no result.
execute($connection as javatype:java.sql.Connection, $statement as xs:string) ➔ item()?
A JDBC database connection established using sql:connect
The SQL statement to be executed
Notes on the Saxon implementation
Introduced in Saxon 9.9. Designed to supersede the extension instruction sql:execute. The
distributed alongside the main JAR file, must be added to the classpath when these SQL extension functions
The function executes a SQL statement, and returns no result.
If the statement is
COMMIT WORK or
ROLLBACK WORK (exactly as written)
then it is intercepted and translated into a call on
Although the declared return type is
item()?, the function always returns an empty
sequence. The declared return type is designed to prevent the optimizer making unwarranted assumptions.
Because this function is executed for its side-effects, it is recommended to invoke it using the saxon:do extension instruction.
Example:<saxon:do action="sql:execute($connection, 'DROP TABLE book')"/>