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 Sybase IQ SQL and Transact-SQL syntax. If you need Transact-SQL compatibility, be sure to use Transact-SQL syntax.
Syntax |
Syntax type |
Explanation |
---|---|---|
procedure_name ('param') |
Sybase IQ |
Quotes are required if you enclose parameters in parentheses. |
procedure_name 'param' |
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 emp1does not. |
procedure_name |
Sybase IQ 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’) |
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.