Interface
SQL API services are provided through CALLs to program PTPSQLRT, which provides a consistent application interface for COBOL programs running on a variety of database platforms. The call has this general form:
CALL 'PTPSQLRT' USING action, sqlrt, cursor, statement, bind-setup, bind-data, select-setup, select-dataThe actual list of parameters that are needed depends on the action requested. For example, a SELECT statement requires all of the previous parameters, while a FETCH action requires only the first three. Only the first two parameters are required in every case.
The following table identifies the parameters, the order coded, and the functions for which they are required:
| Parm # | CALL Parameter | Required for Actions |
|---|---|---|
|
1. |
Action |
All |
|
2. |
SQLRT |
All |
|
3. |
Cursor |
Select, Fetch, Update, Commit, & Disconnect |
|
4. |
Statement |
Select & Update |
|
5. |
Bind-setup |
Select & Update |
|
6. |
Bind-data |
Select & Update |
|
7. |
Select-setup |
Select |
|
8. |
Select-data |
Select |
Communication Area
To use the SQL interface, copy PTCSQLRT into the WORKING-STORAGE topic of the main program and pass this 01-level data to all subprograms using the SQL interface. This member defines data needed by the SQL interface and supports communication between the SQL interface and the application program.