REMOTE PROCEDURE statement

Sends Remote Procedure calls (RPCs) to an external destination.

Syntax

exec_rem_proc_clause select_clause from_clause [matching_clause] [on_clause] [where_clause] [group_by_clause] [having_clause] [order_by_clause] [limit_clause] [output_clause] ;
Components

exec_rem_proc_clause

The remote procedure to execute when the other clauses generate output. See EXECUTE REMOTE PROCEDURE Clause for more information.

select_clause

The select list specifying what to publish. See SELECT Clause for more information. All non-asterisk items in this list must include an AS subclause.

from_clause

The data sources. See FROM Clause for more information.

matching_clause

A pattern-matching specification. See MATCHING Clause for more information.

on_clause

A join condition. See ON Clause for more information.

where_clause

A selection condition. See WHERE Clause for more information.

group_by_clause

A partitioning specification. See GROUP BY Clause for more information.

having_clause

A filter definition. See HAVING Clause for more information.

order_by_clause

A sequencing definition. See ORDER BY Clause for more information.

limit_clause

A limit on the number of rows to publish. See LIMIT Clause for more information.

output_clause

A synchronization specification. See OUTPUT Clause for more information.

Usage

The Remote Procedure statement executes a service defined in the file c8-services.xml. You must have previously configured the service as described in "Enabling Remote Procedure Calls" in the Sybase CEP Installation Guide . This statement is used only to execute procedures on the remote service, not to retrieve data. Data retrieval from remote services is handled by remote subqueries (see Remote Subquery for more information).

The Remote Procedure statement is syntactically similar to the Query statement. It contains a number of clauses that create a query that subscribes to rows from a data stream and then filters and processes the incoming rows. Whenever this process generates output rows, the specified RPC service is invoked and output is sent to the external destination.

Clause Processing Order

The main clauses within a Remote Procedure statement are processed in the following order, which affects the query's output.

  1. FROM clause (with MATCHING conditions, if any).

  2. WHERE clause (with MATCHING conditions, if any).

  3. SELECT clause (in conjunction with GROUP BY, if present).

  4. HAVING clause.

  5. OUTPUT clause.

  6. ORDER BY clause.

  7. LIMIT clause.

  8. INSERT clause.

Restrictions

See Also

Example

EXECUTE REMOTE PROCEDURE "GetManagerApproval"
SELECT
   ManagerName AS Name, 
   ManagerTitle AS Title,
   ManagerPhone AS Phone,
   EmployeeName AS EmployeeName,
   EmployeeTitle AS EmployeeTitle,
   TotalSum AS TotalSum
FROM OrdersWithManager
WHERE ManagerName IS NOT NULL AND 
     (ManagerApprovalLimit IS NULL OR 
      ManagerApprovalLimit < TotalSum);