The or replace clause allows you to replace a SQLJ procedure definitions using create procedure.
Changes are in bold.
create [or replace] procedure [owner_name.]sql_procedure_name ([[in | out | inout] sql_parameter_name sql_datatype [(length)| (precision[, scale ])] [=default] ...]) [,[in | out | inout] sql_parameter_name sql_datatype [(length)| (precision[, scale])]] [=default] ...]) [modifies sql data] [dynamic result sets integer] [deterministic | not deterministic] language java parameter style java external name 'java_method_name [([java_datatype[, java_datatype ...]])] '
create procedure sqlj_proc (param int) language java parameter style java external name 'UDFSample.sample(int)'
create or replace procedure sqlj_proc (p1 int, p2 int) language java parameter style java external name 'UDFSample.add(int,int)'
A Transact-SQL procedure that calls a replaced SQLJ procedure is recompiled when it executes. If replacing the SQLJ procedure changed the number or type of parameters, the calling procedure must be replaced. You can run sp_depends on the replaced procedure to verify whether there are calling procedures that are affected by the changed definition.
Any user who impersonates the procedure owner through an alias or setuser cannot replace the procedure.
Changes for replacing a SQLJ procedure are in bold.
Granular permissions enabled | When granular permissions is enabled, you must have the create procedure privilege. You must have the create any procedure privilege to run create procedure for other users. You must be the procedure owner to replace the procedure. |
Granular permissions disabled | With granular permissions disabled, you must be the database owner or have the create procedure privilege. You must be the procedure owner to replace the procedure. |
Changes are in bold.
Event | Audit Option | Command or access audited | Information in extrainfo |
---|---|---|---|
11 | create | create procedure |
|