There are several stored procedures included in the sample database. The following steps explain how to view and edit stored procedures.
Viewing and editing procedures
Select the Procedures & Functions folder from the sample database in the left panel. You may have to expand the database container to do this.
Right-click the procedure in the right panel; for example sp_customer_list.
In the popup, click Edit in New Window (Ctrl+E). The Sybase Central code editor appears, displaying the text of the procedure.
ALTER procedure "DBA"."sp_customer_list"() result(id integer,company_name char(35)) begin select id,company_name from customer end
Menu options and toolbar buttons let you cut, paste, copy, delete.
When finished editing, save the procedure using the Save Procedure toolbar button or Alt+F, S. If you made no changes, choose File, Close (Alt+F, C).
Select the Procedures & Functions folder from the sample database in the left panel. You may have to expand the database container to do this.
Right-click the procedure in the right panel, for example sp_customer_list.
From the popup, choose Execute from Interactive SQL (Alt+F,u). Click OK.
Sybase Central starts Interactive SQL, connects to the database, and executes the procedure.
A call to the sp_customer_list procedure returns a set of customer IDs and company names from the Customer table.
Stored procedures have permissions associated with them. In order to execute a procedure, you either need to be granted permission to execute a procedure, or you need to be a member of a user group that has permission to execute the procedure.
Viewing and altering procedure permissions
Right-click a procedure and click the Properties toolbar button or select Properties (Alt+R) from the submenu. A properties sheet displays. (For example, right-click sp_customer_list.)
Click the Permissions tab to see which user IDs have been granted permissions on this procedure. For sp_customer_list, none do, as the only user for the sample database is DBA, who automatically has execute permissions as owner of the procedure.
Click Grant to grant users or groups permission to execute this procedure. Grant permission to execute this procedure to the Public user group by selecting the Public user group icon and clicking OK.
Click Cancel or Apply, then OK.