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().

We don't have a way to export this macro.
JavaScript errors detected

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

If this problem persists, please contact our support.