Pathmaker Programming Guide
Generating NonStop SQL Statements
Creating Services and Servers
067868 Tandem Computers Incorporated 4–63
Generating NonStop
SQL Statements
For custom services written in COBOL85 that access data in NonStop SQL tables, the
Pathmaker product can be used to generate some SQL database access statements.
Using two Pathmaker screens, the SQL Operations screen and the Operation
Attributes screen, you can specify information about the SQL database access
statements that you want and then let the Pathmaker product generate the code and
any SQL cursor declarations needed for SQL database access statements it generates
for you.
The code and cursor declarations that the Pathmaker product generates are placed in
the Procedure Division of the associated service using Section names that you have
designated.
You must write statements in the body of the service’s Procedure Division to execute
code within the Pathmaker generated section. You can write COBOL code to:
MOVE values to the host variable associated with the logical file (table)
PERFORM paragraphs within the Pathmaker generated section
Test the standard Pathmaker condition names for SQL errors
MOVE values from the host variable
SQL Operations Screen On the SQL Operations screen, you can specify information that will cause the
generation of sections of code for one or more of the following operations:
UPDATE
DELETE
INSERT
SELECT
FETCH
The code generated for each of these operations is for one logical file only. A logical
file can be a NonStop SQL table, a protection view, or a shorthand view. A shorthand
view can even include a join. Only the SELECT and FETCH operations are allowed on
a shorthand view.
The sections of code generated are associated with only one Pathmaker custom
service.
An unlimited number of entries can be specified for one logical file. Each entry has:
An SQL I/O Section Name, which is the name the Pathmaker product uses to
name the section that it creates containing SQL statements and cursors for this
entry.
Two areas (named Modif and Retrieval) where you can specify the type of SQL
operation you want the Pathmaker product to create (U for Update, D for Delete,
I for Insert, S for Select, or F for Fetch) for this entry.