Alter Procedure
Usage
ALTER PROCEDURE <schemaname>.<procedurename>( ... ) [ RETURNS ( ... ) ] [ OWNER <owner_name>] [EXECUTE AS <executor> ] AS BEGIN <procedure code> END
Syntax Rules
- The
ALTER
block should not includeCREATE VIRTUAL PROCEDURE
; - Do not use
VIRTUAL
as inCREATE VIRTUAL PROCEDURE
; - The
ALTER
block may be prefixed with a cache hint for cached procedures; - Parameters and return values will be used as given in the
ALTER PROCEDURE
command, so they may not be omitted if they should be kept; OWNER
of a procedure can be changed only by admins.EXECUTE AS
hasCALLER
orOWNER
as a possible value and can only be changed by the owner or admins.
Example
ALTER PROCEDURE views.dateaxis() returns (xdate date) OWNER 'test_user' EXECUTE AS CALLER as
BEGIN
SELECT current_date;
END;;
Permission management, i.e. owner and executor for procedure can be modified by using procedure SYSADMIN.changeResourceOwnerAndExecutor().
OWNER
and EXECUTE AS
are available since v4.1
SYSADMIN.changeResourceOwnerAndExecutor
procedure is available since v4.5