Altering procedures

You can modify an existing procedure using either Sybase Central or Interactive SQL. You must have DBA authority or be the owner of the procedure.

In Interactive SQL, you can execute an ALTER PROCEDURE statement to modify an existing procedure. You must include the entire new procedure in this statement (in the same syntax as in the CREATE PROCEDURE statement that created the procedure).

 Alter the code of a procedure (Sybase Central)

You must have DBA authority or be the owner of the procedure.

In Sybase Central, you cannot rename an existing procedure directly. Instead, you must create a new procedure with the new name, copy the previous code to it, and then delete the old procedure.

  1. Use the SQL Anywhere 12 plug-in to connect to the database as a user with DBA or Resource authority.

  2. In the left pane, double-click Procedures & Functions.

  3. Select the procedure.

  4. Use one of the following methods to edit the procedure:

    • In the right pane, click the SQL tab.

    • Right-click the procedure and click Edit In New Window.

      Tip

      You can open a separate window for each procedure and copy code between procedures.

    • To add or edit a procedure comment, right-click the procedure and click Properties.

      If you use the Database Documentation Wizard to document your SQL Anywhere database, you will have the option to include these comments in the output.

 See also