Use the following example to create an ASE stored procedure that executes an remote stored procedure (RSP). The new procedure must specify an existing RSP and provide any arguments that the RSP requires.
create procedure newcust @custname varchar(nn), @custno varchar (nn) as begin execute servername. . .addcust @addname=custname, @addno=custno end
where:
@custname is the customer name to be added.
@custno is the customer number to be added.
servername specifies the access service instance to use. The three periods following servername are required.
addcust is the stored procedure name on the host.
@addname is the stored procedure representing the new customer name.
@addno is the stored procedure representing the new customer number.
To execute the example remote stored procedure using isql
Connect to ASE.
At the prompt, enter the following:
c:>ISQL -Ssybase -Uuser -Ppasswrd 1> execute newcust xxxx,yyyy 2> go
where:
xxxx is the new customer name.
yyyy is the new customer number.
The results obtained depend on the defined addcust stored procedure.