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:
directconnect is the name of the remote server. The three periods following directconnect are required.
dcon is the keyword of the RPC.
WARNING! When using the keyword dcon, the access service will insert a space between each variable.
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.
For 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:
Adaptive Server determines whether the remote server directconnect is configured as a remote server:
If the remote server is not configured correctly, the request fails.
If the remote server is configured correctly, Adaptive Server checks for a site handler connection to the remote server.
Adaptive Server does one of the following:
If the site handler connection exists, Adaptive Server connects to the remote server, triggering a connect event in DirectConnect.
If the connect event processes successfully, Adaptive Server triggers an RPC event in DirectConnect and submits the RPC called dcon. The first parameter to the RPC is the dynamic SQL language statement that is executed.
If the site handler connection does not exist, Adaptive Server establishes one.
This connection exists for the term of the RPC. It is reused if Adaptive Server submits other RPCs.