Creating Procedures

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

See SQL Anywhere 11.0.1 > SQL Anywhere Server - SQL Usage > Stored Procedures and Triggers > Using procedures, triggers, and batches > Introduction to procedures > Creating procedures.

Sybase IQ Example

Note:

For examples, use the Sybase IQ demo database iqdemo.db.

CREATE PROCEDURE new_dept(IN id INT,
 			IN name CHAR(35), 
				IN head_id INT)
BEGIN
		INSERT
				INTO GROUPO.departments(DepartmentID, 
				DepartmentName, 
				DepartmentHeadID)
				values (id, name, head_id);
END
Note:

To 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. The Create Remote Procedure Wizard in Sybase Central is available only for remote servers.