Pathmaker Programming Guide

Coding Custom Services
Creating Services and Servers
067868 Tandem Computers Incorporated 4–53
Notice that the DDL clauses for HEADING text contain a slash (/). The slash indicates
to Pathmaker where you want the title for each column to be broken.
Assume that you specified the name ORDERS-HOST (which is a logical file name that
you entered on the Logical File Entries screen) as the host variable name for the
ORDERS table and the name CUSTOMER-HOST as the host variable name for the
CUSTOMER table. The following code fragment illustrates how you could code your
service to send a list of values to this requester:
?SECTION T9WS-SVC-001
0200-DECLARE-CURSOR.
EXEC SQL CONTROL QUERY INTERACTIVE ACCESS ON END-EXEC.
EXEC SQL
DECLARE CURSOR_1 CURSOR FOR
SELECT ORDERNUM, DELIVDATE, CUSTNAME
FROM =ORDERS, =CUSTOMER
WHERE ((ORDERNUM > = :ORDERNUM OF ORDERS-HOST) AND
(CUSTOMER.CUSTNUM = :CUSTNUM OF CUSTOMER-HOST) AND
(ORDERS.CUSTNUM = CUSTOMER.CUSTNUM ))
ORDER BY ORDERNUM
END-EXEC.
. . .
?SECTION T9PR-SVC-001
. . .
MOVE ORDERNUM OF T9154-REQUEST
TO ORDERNUM OF ORDERS-HOST
MOVE CUSTNUM OF T9154-REQUEST
TO CUSTNUM OF CUSTOMER-HOST
PERFORM 0500-FETCH-AND-LOAD-DATA
VARYING INDEX FROM 1 BY 1
UNTIL INDEX = END-OF-LIST.
. . .
0500-FETCH-AND-LOAD-DATA.
EXEC SQL
FETCH CURSOR_1
INTO :ORDERNUM OF ORDERS-HOST,
:DELIVDATE OF ORDERS-HOST,
:CUSTNUM OF ORDERS-HOST
END-EXEC
MOVE ORDERNUM OF ORDERS-HOST
TO ORDERNUM (INDEX) OF T9154-REPLY
MOVE DELIVDATE OF ORDERS-HOST
TO DELIVDATE (INDEX) OF T9154-REPLY
MOVE CUSTNAME OF CUSTOMER-HOST
TO CUSTNAME (INDEX) OF T9154-REPLY.
See “Creating a NonStop SQL Pathmaker Application” in Section 10 for another
example of fetching a list of values.