Appendix A Executing Methods As Stored Procedures


Creating invocation commands

Each method call requires a Transact-SQL® exec command that specifies the component name, the method name, and parameter values, as in:

exec MyPackage.MyComponent.MyMethod param1, param2, ...

You can also include the Jaguar server name in the invocation, as in:

exec MyServer.MyPackage.MyComponent.MyMethod param1, param2, ...

The method call can return return values (including multiple result sets) and inout and out parameter values just like a stored procedure. MASP only supports primitive types, that is, the types listed in the pulldown menu from within Jaguar Manager's Define Parameter dialog box.

If the Jaguar method returns a value and not void, TabularResults::ResultSet, or TabularResults::ResultSets, the method's return value is returned as the first output parameter in the stored procedure results. In this case, you must define a dummy output parameter to receive the method's return value. Use this variable in place of the first stored procedure parameter in the request. For example, in a Client-Library client application, you would need to implement a ct_param() call for the return value.

In tools that allow exec commands to be batched, you can send several invocations in the same batch, as in:

exec Pkg1.Comp1.Meth1
exec Pkg1.Comp2.Meth2
exec Pkg1.Comp2.Meth3

Some tools may require the parts of the stored procedure name to be entered separately. In this case, the mappings are as follows:

Stored procedure name part

MASP equivalent

Remote server name

Jaguar server name

Database

Package name

Owner

Component name

Procedure name

Method name

 


Copyright © 2000 Sybase, Inc. All rights reserved.