EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 479

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9 SQL Statements
461
WHERE department.dept_name = @deptname
AND department.dept_id = employee.dept_id
The following is the corresponding Watcom-SQL procedure:
CREATE PROCEDURE showdept(in deptname
varchar(30) )
RESULT ( lastname char(20), firstname char(20))
ON EXCEPTION RESUME
BEGIN
SELECT employee.emp_lname, employee.emp_fname
FROM department, employee
WHERE department.dept_name = deptname
AND department.dept_id = employee.dept_id
END
Procedure body The body of a Transact-SQL procedure is a list of
Transact-SQL statements prefixed by the AS keyword. The body of a
Watcom-SQL procedure is a compound statement, bracketed by BEGIN
and END keywords.
SQL/92 Transact-SQL extension.
Sybase Anywhere supports a subset of the Adaptive Server Enterprise
CREATE PROCEDURE statement syntax.
If the Transact-SQL WITH RECOMPILE optional clause is supplied, it
is ignored. Adaptive Server 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.
Standards and
compatibility

Table of Contents

Related product manuals