Calling a Sybase Stored Procedure Using SQL Passthru

How to:

x

Sybase stored procedures are supported using SQL Passthru. These procedures need to be developed within Sybase using the CREATE PROCEDURE command. A Sybase stored procedure is in either chained or unchained transaction mode. To change the default CHAINED property, see How to Run an Unchained Sybase Stored Procedure.


Top of page

x
Syntax: How to Call a Sybase Stored Procedure

The supported syntax to call a stored procedure is shown below. It is recommended that you use the syntax below instead of the previously supported CALLSYB syntax.

ENGINE SQLSYB
EX SAMPLE PARM1,PARM2,PARM3...;
TABLE ON TABLE PCHOLD
END

where:

SQLSYB

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.



Example: Sybase Stored Procedure
CREATE PROCEDURE SAMPLE
AS
SELECT SSN5, LAST_NAME5, FIRST_NAME5, BIRTHDATE5, SEX5 FROM EDAQA.NF29005
go
exec sp_procxmode 'PROC1','anymode'
go

Top of page

x
Syntax: How to Run an Unchained Sybase Stored Procedure

Sybase ASE stored procedures may be in either chained or unchained transaction mode.

By default, the Adapters for Sybase run stored procedures in chained transaction mode. If you want to run an unchained Sybase stored procedure, you need to first set the adapter CHAINED property to OFF using the following command:

ENGINE SQLSYB SET CHAINED {OFF|ON};
END

where:

SQLSYB

Indicates the adapter ASE. You can omit this value if you had previously issued the SET SQLENGINE command.

OFF

Sets the adapter to unchained transaction mode.

ON

Sets the adapter to chained transaction mode.

The adapter is in chained transaction mode by default.

You can issue this command in a server procedure (focexec) or in the server profile (edasprof).


iWay Software