Contents Index Using remote procedure calls (RPCs) Dropping remote procedures

ASA SQL User's Guide
  Accessing Remote Data
    Using remote procedure calls (RPCs)

Creating remote procedures


You can issue a remote procedure call using either Sybase Central or the CREATE PROCEDURE statement.

You must have DBA authority to create a remote procedure.

To issue a remote procedure call (Sybase Central)

  1. Connect to the host database from Sybase Central.

  2. Open the Remote Servers folder.

  3. In the left pane, select the remote server for which you want to create a remote procedure.

  4. In the right pane, click the Remote Procedures tab.

  5. From the File menu, choose New > Remote Procedure.

    The Remote Procedure Creation wizard appears.

  6. Follow the instructions in the wizard.

To issue a remote procedure call (SQL)

  1. First define the procedure to Adaptive Server Anywhere.

    The syntax is the same as a local procedure definition except instead of using SQL statements to make up the body of the call, a location string is given defining the location where the procedure resides.

    CREATE PROCEDURE remotewho ()
    AT 'bostonase.master.dbo.sp_who'
  2. Execute the procedure as follows:

    call remotewho()

For more information, see CREATE PROCEDURE statement.

Example 

Here is an example with a parameter:

CREATE PROCEDURE remoteuser (IN uname char(30))
AT 'bostonase.master.dbo.sp_helpuser'
call remoteuser('joe')
Data types for remote procedures 

The following data types are allowed for RPC parameters. Other data types are disallowed:

NUMERIC and DECIMAL data types are allowed for IN parameters, but not for OUT or INOUT parameters.


Contents Index Using remote procedure calls (RPCs) Dropping remote procedures