Alter Procedure
Usage
ALTER PROCEDURE <schemaname>.<procedurename>( ... ) [ RETURNS ( ... ) ] [ OWNER <owner_name>] [EXECUTE AS <executor> ] AS BEGIN <procedure code> END
Syntax Rules
- The
ALTERblock should not includeCREATE VIRTUAL PROCEDURE; - Do not use
VIRTUALas inCREATE VIRTUAL PROCEDURE; - The
ALTERblock may be prefixed with a cache hint for cached procedures; - Parameters and return values will be used as given in the
ALTER PROCEDUREcommand, so they may not be omitted if they should be kept; OWNERof a procedure can be changed only by admins.EXECUTE AShasCALLERorOWNERas 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().