Syntax Rules for Stored Procedures

Use of parentheses and quotes in stored procedure calls varies, depending on whether you enter the procedure name directly, as you can in Interactive SQL, or invoke it with a CALL statement.

Some variations are permitted because the product supports both SAP Sybase IQ SQL and Transact-SQL syntax. If you need Transact-SQL compatibility, be sure to use Transact-SQL syntax.

Stored Procedure Syntax Variations

Syntax

Syntax Type

Explanation

procedure_name ('param')

SAP Sybase IQ

Quotes are required if you enclose parameters in parentheses.

procedure_name 'param'

SAP Sybase IQ

Parentheses are optional if you enclose parameters in quotes.

procedure_name param

Transact-SQL

If you omit quotes around parameters, you must also omit parentheses.
Note: Quotes are always required around parameters when the owner is specified. For example, assuming the owner is dba,
sp_iqtablesize 'dba.emp1'
requires quotes around the parameters.
sp_iqtablesize emp1
does not.
procedure_name

SAP Sybase IQ or Transact-SQL

Use this syntax if you run a procedure with no parameters directly in Interactive SQL, and the procedure has no parameters.

call procedure_name (param=’value’)

SAP Sybase IQ

Use this syntax to call a procedure that passes a parameter value.

When you use Transact-SQL stored procedures, you must use the Transact-SQL syntax.