Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Accessing Remote Data » Using remote procedure calls (RPCs)

Using remote procedure calls (RPCs) Next Page

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 Create Remote Procedure wizard appears.

  6. Follow the instructions in the wizard.

To issue a remote procedure call (SQL)
  1. Define the procedure to SQL Anywhere.

    The syntax is the same as a local procedure definition, except instead of using SQL statements to make up the body of the procedure, 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();
  3. For more information, see CREATE PROCEDURE statement.


    Here is an example that specifies a parameter when calling a remote procedure:

    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: