Creating and executing Adaptive Server stored procedures  Rules for using language statements as RPCs

Chapter 7: Issuing RPC Events

Executing a language statement as an RPC

To execute a SQL language statement to the DirectConnect access service through an RPC, use the following syntax:

C:> isql -Sadaptiveserver -Uuser -Ppassword
 1> execute directconnect. . .dcon “select * from user.authors”
 2> go

where:

The access service RPC event handler is sensitive to several RPC keywords, including the keyword dcon used in this example. An RPC can have many parameters. Before the resulting string is executed, all parameters are concatenated. The access service translates the first parameter into a dynamic SQL statement, submits it to the target database, and returns the result set to the client application.

NoteFor backward compatibility with the MDI Database Gateway™, pcsql is recognized in place of the dcon keyword. For backward compatibility with Net-Gateway™, syrt is recognized in place of the dcon keyword.

The event sequence is as follows:

  1. Adaptive Server determines whether the remote server directconnect is configured as a remote server:

  2. Adaptive Server does one of the following:

    This connection exists for the term of the RPC. It is reused if Adaptive Server submits other RPCs.





Copyright © 2005. Sybase Inc. All rights reserved. Rules for using language statements as RPCs

View this book as PDF