The client application can create a stored procedure within Adaptive Server that invokes the DB2 access service transfer function. In this case, the DB2 access service receives the transfer command as an RPC event with the arguments shown in the following table:
Argument |
Definition |
---|---|
Argument 1 |
The secondary connection information ({to | from} “server userid pw”) |
Argument 2 |
Either the bulk copy target command (for example, with replace into) or the destination-template sourceselectstatement |
Argument 3 |
Either the bulk copy sourceselectstatement or the destination-template sourceselectstatement |
Following is an example of a Adaptive Server stored procedure that initiates a bulk copy transfer statement. The DB2 access service executes the transfer statement against DB2, and DB2 receives it as an RPC.
create procedure replauth as begin execute servername...transfer “to ‘servername2 userid password’;”, “with replace into authors;”, “select * from authors;” end
where:
replauth is the name of the stored procedure.
servername specifies the DB2 access service that handles the transfer. The three periods (. . .) following the servername are required. The DB2 access service recognizes anything other than transfer in the next position as the name of a stored procedure.
transfer is the name of the RPC.
servername2 is the secondary database for the transfer command.
Copyright © 2005. Sybase Inc. All rights reserved. |