ASA SQL User's Guide
Using Procedures, Triggers, and Batches
Introduction to 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 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.
Alternatively, you can use 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). You must also reassign user permissions on the procedure.
For more information on altering database object properties, see Setting properties for database objects.
For more information on granting or revoking permissions for procedures, see Granting permissions on procedures and Revoking user permissions.
To alter the code of a procedure (Sybase Central)
Open the Procedures & Functions folder.
Select the desired procedure. You can then do one of the following:
Edit the code directly on the SQL tab in the right pane.
Translate the code to Watcom-SQL or Transact-SQL prior to editing it:
Right-click the desired procedure and choose Open as Watcom-SQL or Open as Transact-SQL from the popup menu.
Edit the code on the SQL tab in the right pane.
Edit the code in a separate window by right-clicking the procedure in the right pane and choose Edit In New Window from the popup menu.
TipIf you wish to copy code between procedures, you can open a separate window for each procedure. |
To alter the code of a procedure (SQL)
Connect to the database.
Execute an ALTER PROCEDURE statement. Include the entire new procedure in this statement.
For more information, see ALTER PROCEDURE statement, CREATE PROCEDURE statement, and Creating procedures.