Creating a transfer SQL request

The client application can create a stored procedure within ASE 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 Table 7-1:

Table 7-1: Arguments for transfer command

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

This is an example of an ASE stored procedure that initiates a bulk copy transfer statement. The DB2 access service executes the transfer statement against DB2 UDB, and DB2 UDB 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: