Introduction
If you're using a JDBC Write Connector and want to call a stored procedure in a Post-SQL Hook, you can do so using the JDBC escape syntax. In this article, we'll explain how to call stored procedures with and without input parameters, and provide valid examples.
Calling Stored Procedures with No Input Parameters
To call a stored procedure with no input parameters, you can use the following syntax:
CALL procedure-name
{ CALL procedure-name }
Note that the braces around CALL procedure-name
are optional. You can choose to include them for consistency, but they're not necessary.
Calling Stored Procedures with Input Parameters
To call a stored procedure with input parameters, you must use the JDBC escape syntax with curly braces. Here's the syntax you should use:
{ CALL procedure-name(?, ?, ...) }
Make sure to include the braces and replace the question marks with the actual input parameters.
Examples of Calling Stored Procedures in Post-SQL Hook
Here are some valid examples of calling stored procedures in a Post-SQL Hook using the JDBC escape syntax:
CALL MY_SCHEMA.MY_PROC
{ CALL MY_SCHEMA.MY_PROC }
CALL MY_SCHEMA.MY_PROC(10, 'abc')
{ CALL MY_SCHEMA.MY_PROC(10, 'abc') }
Conclusion
Calling stored procedures in a Post-SQL Hook using the JDBC escape syntax is a straightforward process. Just remember to use braces and replace question marks with actual input parameters when calling stored procedures with input parameters
Comments
0 comments
Please sign in to leave a comment.