Creating remote procedures (SQL)

Administrators can create remote procedures in Interactive SQL.

Prerequisites

DBA authority.

Context and remarks

If a remote procedure can return a result set, even if it does not always return one, then the local procedure definition must contain a RESULT clause.

 Create a remote procedure
  1. Connect to the host database.

  2. Execute a statement to define the procedure to SQL Anywhere.

    For example:

    CREATE PROCEDURE RemoteWho()
    AT 'bostonase.master.dbo.sp_who';

    The syntax is similar to a local procedure definition. The location string defines the location of the procedure.

Results

The remote procedure is created.

Next

None

Example

This example specifies a parameter when calling a remote procedure:

CREATE PROCEDURE RemoteUser ( IN username CHAR( 30 ) )
AT 'bostonase.master.dbo.sp_helpuser';
CALL RemoteUser( 'joe' );

 See also