Creating procedures

Procedures are created using the CREATE PROCEDURE statement. You must have RESOURCE authority to create a procedure.

See ”Creating procedures”in SQL Anywhere Server - SQL Usage.

Sybase IQ example

NoteFor examples, use the Sybase IQ demo database iqdemo.db. For installation information, see “The demo database”.

create procedure new_dept(IN id INT, IN name CHAR(35), IN head_id INT)BEGININSERTINTO GROUPO.departments(DepartmentID, DepartmentName, DepartmentHeadID)values (id, name, head_id);END

NoteTo create a remote procedure in IQ, you must use the AT location-string SQL syntax of CREATE PROCEDURE to create a proxy stored procedure. This capability is currently certified on only Windows and Sun Solaris. See “Using remote procedure calls (RPCs)”. The Create Remote Procedure Wizard in Sybase Central is available only for remote servers.