Procedures return results to the calling environment in one of the following ways:
Individual values are returned as OUT or INOUT parameters.
Result sets can be returned.
A single result can be returned using a RETURN statement.
See ”Returning procedure results in parameters” in SQL Anywhere Server - SQL Usage.
For examples, use the Sybase IQ demo database iqdemo.db. For installation information, see “The demo database”.
CREATE PROCEDURE SalaryList (IN department_id INT)RESULT ( "Employee ID" INT, "Salary" NUMERIC(20,3) )BEGINSELECT EmployeeID, SalaryFROM EmployeesWHERE Employees.DepartmentID = department_id;END