Creating and Executing Adaptive Server Remote Stored Procedures

Create an Adaptive Server stored procedure that executes a remote stored procedure (RSP).

  1. Connect to Adaptive Server using isql.
  2. At the prompt, enter:
    create procedure newcust @custname varchar(nn),
     @custno varchar (nn) as
     begin
     execute servername. . .addcust
     @addname=custname, @addno=custno
    end
    where:
    • @custname specifies the customer name.

    • @custno specifies the customer number.

    • servername specifies the access service instance to use. The three periods (...) afterservername 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.

    Note: The new procedure must specify an existing RSP and provide any arguments that the RSP requires.

Example 1: Executes an RSP using isql:

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.