Skip to main content

Executing a Stored Procedure as a Masking Pre-Script or Post-Script (KBA6373)



KBA# 6373



When creating a Masking pre-script or post-script, you may want to include the execution of a Stored Procedure as part of that script.  Since the Masking Engine already has a database connection open (via JDBC), the Masking Engine executes a customer script by sending the SQL across the JDBC connection to be executed in the database.

Many customers are familiar with executing a Stored Procedure from a SQL browser prompt (such as TOAD or SQLPlus). They are often used to using browser shortcuts (such as EXECUTE) to accomplish this.  Unfortunately, because we are not going through a SQL browser but directly to the database across the JDBC connection, these methods will not work.

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases




5.0,,,,,,,,, ,,,,,


4.2,,,,,,, ,,



The proper way to execute a Stored Procedure across a JDBC connection is to use the SQL CALL command.  For Oracle, this looks like:

CALL [<schema>].[<package>].<stored_procedure_name>([<arg1>], [<arg2>], ...);

An example of a script to execute a simple Stored Procedure called foo_tag not in any package, but in the schema delphix which requires 1 argument which is the current date and time as a TIMESTAMP WITH TIMEZONE data type would look like:

CALL delphix.foo_tag(CURRENT_TIMESTAMP);



When you create these Stored Procedures, a common problem is that the Masking DB user does not have permissions for the Stored Proc or for subsequent tables, etc. that the stored proc attempts to manipulate.




Debugging information is only available in the logs or in our internal database.  If you download a support logs bundle, you can decompress and un-tar the bundle to get to the logs.  Or, you can open a case with Delphix Support and upload a support logs bundle, letting your support agent know what job ID was encountering the problem to receive assistance with debugging issues with pre- and post-scripts.


Related Articles

The following articles may provide more information or related information to this article: