Creates a new procedure that is compatible with Adaptive Server.
This subset of the Transact-SQL CREATE PROCEDURE statement is supported in SAP Sybase IQ:
CREATE [ OR REPLACE ] PROCEDURE [ owner.]procedure_name … [ [ ( ] @parameter_name data-type [ = default ] [ OUTPUT ] [ , … ] [ ) ] ] …[ WITH RECOMPILE ] … AS … statement-list
Differences between Transact-SQL and SAP Sybase IQ SQL statements:
CREATE PROCEDURE showdept @deptname varchar(30) AS SELECT Employees.Surname, Employees.givenName FROM Departments, Employees WHERE Departments.DepartmentName = @deptname AND Departments.DepartmentID = Employees.DepartmentID
The corresponding SAP Sybase IQ procedure:
CREATE PROCEDURE showdept(in deptname varchar(30) ) RESULT ( lastname char(20), firstname char(20)) ON EXCEPTION RESUME BEGIN SELECT Employees.SurName, Employees.GivenName FROM Departments, Employees WHERE Departments.DepartmentName = deptname AND Departments.DepartmentID = Employees.DepartmentID END
If the Transact-SQL WITH RECOMPILE optional clause is supplied, it is ignored. SQL Anywhere always recompiles procedures the first time they are executed after a database is started, and stores the compiled procedure until the database is stopped.
Groups of procedures are not supported.
Watcom SQL or Transact SQL procedure to be owned by self – Requires CREATE PROCEDURE system privilege.