Skip to main content
Skip table of contents

Alter Procedure

Usage

SQL
ALTER PROCEDURE <schemaname>.<procedurename>( ... ) [ RETURNS ( ... ) ] [ OWNER <owner_name>] [EXECUTE AS <executor> ] AS BEGIN <procedure code> END

Syntax Rules

  • The ALTER block should not include CREATE VIRTUAL PROCEDURE;
  • Do not use VIRTUAL as in CREATE 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 has CALLER or OWNER as a possible value and can only be changed by the owner or admins.

Example

SQL
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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.