Using remote procedure calls (RPCs)

Sybase IQ users can issue procedure calls to remote servers that support the feature.

Sybase Sybase IQ, Adaptive Server Anywhere, and Adaptive Server Enterprise, as well as Oracle and DB2, support this feature. Issuing a remote procedure call is similar to using a local procedure call.

StepsIssuing a remote procedure call

  1. First define the procedure to Sybase IQ.

    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 remoteuser (IN uname char(30))
    AT 'bostonase.master.dbo.sp_helpuser'
    
  2. Execute the procedure as follows:

    call remoteuser ('josh')
    

Here is another example:

CREATE PROCEDURE sp_tables_remote
(IN table_name char(128))
 AT 'asiqdemo_srv...sp_tables'

You can execute the procedure either as

call sp_tables_remote ('employee')

or from DBISQL as

sp_tables_remote employee

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.

To delete a remote procedure, connect to the database and execute a DROP PROCEDURE statement.