SQL Client Integration Exit Program


  Required Parameter Group:

1 Interface level Input Binary(4)
2 Input format Input Char(*)
3 Length of input format Input Binary(4)
4 Input format name Input Char(8)
5 SQLCA Output Char(136)
6 CCSID Output Binary(4)
7 Output format Output Char(*)
8 Length of output format Output Binary(4)

  QSYSINC Member Name: ERWSCI

The SQL Client Integration exit program enables SQL applications to access data managed by a database management system other than the i5/OS relational database. An application requester driver (ARD) program is the generic term for this type of exit program. The two terms are used interchangeably throughout this topic. The system calls the ARD program during the following operations:

The CL commands that correspond to this exit program are the Add Relational Database Directory Entry (ADDRDBDIRE) and the Change Relational Database Directory Entry (CHGRBDDIRE) commands. Information about the ARD program must be defined to the system by adding it to the RDB directory using the ADDRDBDIRE command. Entries in the RDB directory that refer to ARD programs contain the keyword *ARDPGM in the remote location field. Each entry must identify the qualified ARD program name and the RDB name that it should be associated with. Also stored in the RDB directory entry is the level of interface that the ARD program expects to be called with. Currently the only value allowed is 1. An ARD program can be defined to process requests for several different RDBs by specifying the same ARD program for each RDB directory entry the ARD program is to process.


Restrictions

The following operations are not allowed in the ARD program or any program it calls:

DECLARE CURSOR statements must parse successfully on the application requester to be used through this interface.

The ARD program must be in a library that is part of the system auxiliary storage pool (ASP number 1) or a configured basic ASP (ASP numbers 2-32).

The following functions are not supported for the SQL Client Integration exit program interface:


Required Parameter Group

Interface level
INPUT; BINARY(4)

The level of the ARD program. The only value that will currently be passed is 1 because no value can be specified on the RDB directory commands. It is possible that updates to the interface could be made in the future.

For example, such updates could include:

Changes to enumerated values without changes to a structure will not result in a new interface level. Therefore, the ARD program should reject any unexpected values in the input format structures, or in the input SQLDA structure. In addition, the product identifier field on the ARCN0100 format can be used to determine the level of the local database that also identifies the values that could be expected for enumerated values in the input format and SQLDA structure. If updates are made to the interface, it may be possible for ARD programs to be registered with levels other than one by specifying the level on the RDB directory commands. At such time, a user registering the ARD program may incorrectly specify a level other than one for a program that only understands the level one interface. Therefore, ARD programs written to understand the current interface, the level one interface, should return an error if a level other than one is passed.

Input format
INPUT; CHAR(*);

The input format. The following table identifies the formats that the system will pass to the ARD program for each of the input format name values.

Note: General information on the nature of the functions associated with the various input formats listed may be found in the Distributed Relational Database Architecture Reference, SC26-4651. The chapter about the DRDA processing model and command flows should be of particular interest in this regard.

Relationship between Input Format Name and Input Format

Input Format Name Input Format
ARCN0100 See Format ARCN0100 (Connect Format).
ARDI0100 See Format ARDI0100 (Disconnect Format).
ARBB0100 See Format ARBB0100 (Begin Package Bind Format).
ARBS0100 See Format ARBS0100 (Bind Statement for Package Creation Format).
AREB0100 See Format AREB0100 (End of Package Bind Format).
ARPS0100 See Formats ARPS0100 and ARPD0100 (Prepare Format).
ARPD0100 See Formats ARPS0100 and ARPD0100 (Prepare Format).
ARXD0100 See Formats ARXD0100 and ARXB0100 (Execute Bound Statement).
ARXB0100 See Formats ARXD0100 and ARXB0100 (Execute Bound Statement).
ARXP0100 See Format ARXP0100 (Execute Prepared Statement).
ARXI0100 See Format ARXI0100 (Execute Immediate Statement Format).
AROC0100 See Format AROC0100 (Open Cursor Format).
ARFC0100 See Format ARFC0100 (Fetch from a Cursor Format).
ARCC0100 See Format ARCC0100 (Close a Cursor Format).
ARDS0100 See Format ARDS0100 (Describe a Statement Format).
ARDT0100 See Format ARDT0100 (Describe Object Format).

Length of input format
INPUT; BINARY(4)

The length of the input format in bytes.

Input format name
INPUT; CHAR(8)

The format of the information passed to the ARD program. The possible format names follow:

ARCN0100
Connect format. This format will be used by the system to pass information to the ARD program when a user or application attempts to connect to an RDB name corresponding to the ARD program. This format will always be passed to the ARD program before any other formats for a given connection. If running under commitment control, the system will register an RDB resource with commitment control. However, the provider of the ARD program must also register with commitment control using the commitment control APIs to be informed of commit and rollback requests so that it processes those requests and closes cursors as necessary. Refer to Commit APIs for a description of how to use commitment control APIs with ARD programs. See Format ARCN0100 (Connect Format) for the structure of the input format that the system will pass to the ARD program for this input format name. See Output Connect Format for the structure of the output format that the ARD program must return to the system in response to this input format name.
ARDI0100
Disconnect format. This format will be used by the system to pass information to the ARD program when a user, application, or the system attempts to disconnect from an RDB name that corresponds to the ARD program. See Format ARDI0100 (Disconnect Format) for the structure of the input format that the system will pass to the ARD program for this input format name. No output format is returned from ARD program for this input format name.
ARBB0100
Begin package bind format. This format will be used by the system to pass information to the ARD program when a user or application attempts to create a package and specifies an RDB name corresponding to the ARD program. See Format ARBB0100 (Begin Package Bind Format) for the structure of the input format that the system will pass to the ARD program for this input format name. No output format is returned from the ARD program for this input format name.
ARBS0100
Bind statement for package creation format. This format will be used by the system to pass information about an SQL statement to the ARD program when a user or application attempts to create a package and specifies an RDB name corresponding to the ARD program. See Format ARBS0100 (Bind Statement for Package Creation Format) for the structure of the input format that the system will pass to the ARD program for this input format name. No output format is returned from ARD program for this input format name.
AREB0100
End of package bind format. This format will be used by the system to pass information to the ARD program about the end-the-package-creation function when a user or applications attempts to create a package and specifies an RDB name that corresponds to the ARD program. See Format AREB0100 (End of Package Bind Format) for the structure of the input format that the system will pass to the ARD program for this input format name. No output format is returned from ARD program for this input format name.
ARPS0100
Prepare statement format. This format will be used by the system to pass information about an SQL statement to the ARD program when an application attempts to prepare a statement. See Formats ARPS0100 and ARPD0100 (Prepare Format) for the structure of the input format that the system will pass to the ARD program for this input format name. No output format is returned from ARD program for this input format name.
ARPD0100
Prepare and describe format. This format will be used by the system to pass information about an SQL statement to the ARD program when an application attempts to prepare a statement and expects a description of the prepared statement to be returned into an SQL descriptor area (SQLDA). See Formats ARPS0100 and ARPD0100 (Prepare Format) for the structure of the input format that the system will pass to the ARD program for this input format name. See SQLDA for the structure of the output format that the ARD program must return to the system in response to this input format name.
ARXD0100
Execute bound statement that returns data format. This format will be used by the system to pass information about an SQL statement to the ARD program when an application attempts to execute a statement that expects data to be returned and was bound at package creation time by a call to the ARD program with format ARDSB001. An example of a statement that expects data to be returned is a SELECT INTO statement. See Formats ARXD0100 and ARXB0100 (Execute Bound Statement) for the structure of the input format that the system will pass to the ARD program for this input format name. See Output Execute Format for the structure of the output format that the ARD program must return to the system in response to this input format name.
ARXB0100
Execute bound statement that does not return data format. This format will be used by the system to pass information about an SQL statement to the ARD program when an application attempts to execute a statement that does not return data and was bound at package creation time by a call to the ARD program with format ARDSB001. See Formats ARXD0100 and ARXB0100 (Execute Bound Statement) for the structure of the input format that the system will pass to the ARD program for this input format name. The output format that the ARD program must return to the system in response to this input format name is a character (CHAR(1)) field containing an indication of whether the statement resulted in an update. An update is any operation that results in a change to an object such that the object is under commitment control.

Valid values follow:

0 The operation did not result in an update.
1 An update occurred from the operation.

ARXP0100
Execute prepared statement format. This format will be used by the system to pass information about an SQL statement to the ARD program when an application attempts to execute a statement that was previously prepared by a call to the ARD program with either format ARPS0100 or ARPD0100. See Format ARXP0100 (Execute Prepared Statement) for the structure of the input format that the system will pass to the ARD program for this input format name. The output format that the ARD program must return to the system in response to this input format name is a character (CHAR(1)) field containing an indication of whether the statement resulted in an update. An update is any operation that results in a change to an object such that the object is under commitment control.

Valid values follow:

0 The operation did not result in an update.
1 An update occurred from the operation.

ARXI0100
Execute immediate statement format. This format will be used by the system to pass information about an SQL statement to the ARD program when an application attempts to execute a statement that was not previously prepared. See Format ARXI0100 (Execute Immediate Statement Format) for the structure of the input format that the system will pass to the ARD program for this input format name. The output format that the ARD program must return to the system in response to this input format name is a character (CHAR(1)) field that contains an indication of whether the statement resulted in an update. An update is any operation that results in a change to an object such that the object is under commitment control.

Valid values follow:

0 The operation did not result in an update.
1 An update occurred from the operation.

AROC0100
Open a cursor format. This format will be used by the system to pass information about an SQL OPEN statement to the ARD program when an application attempts to execute the statement. See Format AROC0100 (Open Cursor Format) for the structure of the input format that the system will pass to the ARD program for this input format name. See Output Open Cursor Format for the structure of the output format that the ARD program must return to the system in response to this input format name.
ARFC0100
Fetch from a cursor format. This format will be used by the system to pass information about an SQL FETCH statement to the ARD program when an application attempts to execute the statement. See Format ARFC0100 (Fetch from a Cursor Format) for the structure of the input format the system will pass to the ARD program for this input format name. See Output Fetch Cursor Format for the structure of the output format that the ARD program must return to the system in response to this input format name.
ARCC0100
Close a cursor format. This format will be used by the system to pass information about an SQL CLOSE statement to the ARD program when an application attempts to execute the statement. See Format ARCC0100 (Close a Cursor Format) for the structure of the input format that the system will pass to the ARD program for this input format name. No output format is returned from ARD program for this input format name.
ARDS0100
Describe an SQL statement format. This format will be used by the system to pass information about an SQL DESCRIBE STATEMENT statement to the ARD program when an application attempts to execute the statement. See Format ARDS0100 (Describe a Statement Format) for the structure of the input format that the system will pass to the ARD program for this input format name. See SQLDA for the structure of the output format that the ARD program must return to the system in response to this input format name.
ARDT0100
Describe an SQL table format. This format will be used by the system to pass information about an SQL DESCRIBE TABLE statement to the ARD program when an application attempts to execute the statement. See Format ARDT0100 (Describe Object Format) for the structure of the input format that the system will pass to the ARD program for this input format name. See SQLDA for the structure of the output format that the ARD program must return to the system in response to this input format name.

SQLCA
OUTPUT; CHAR(136)

The SQL communication area. This is used for returning diagnostic information. The format of the structure is standard, and can be included using the INCLUDE SQLCA statement in an SQL program. The SQLCA has the following fields (shown in the C-language format):

struct sqlca
 {
    unsigned char  sqlcaid[8];
    long           sqlcabc;
    long           sqlcode;
    short          sqlerrml;
    unsigned char  sqlerrmc[70];
    unsigned char  sqlerrp[8];
    long           sqlerrd[6];
    unsigned char  sqlwarn[11];
    unsigned char  sqlstate[5];
 };

Fields that must be set by the ARD program prior to returning follow:


sqlcaid An eye-catcher for diagnostic purposes. This must be set to 'SQLCA'.
sqlcabc The byte length of the SQLCA. This must be set to 136.
sqlcode The SQL return code. If the sqlcode is 0, the statement completed successfully although a warning may have occurred. If the sqlcode is positive, the statement completed successfully but a warning occurred during execution. If the sqlcode is negative, an error occurred while running the statement. A discussion about setting the sqlcode to match a system message identifier follows this list of fields.
sqlerrp The program that detected the error and built the SQLCA.
sqlerrd[2] The number of rows affected for successful INSERT, and DELETE statements. This cannot be zero for INSERT, UPDATE, and DELETE statements when the sqlstate is 00000.
sqlstate A return code field that indicates the outcome of the most recently executed SQL statement. An sqlstate of 00000 indicates an unqualified successful completion. ANS/ISO standard sqlstate values should be used and are documented in the DB2 UDB for iSeries SQL Programming topic in the Information center.

Another field in the SQLCA, sqlerrmc, is used to return additional pertinent information about the last statement run. Tokens in this field must be separated by X'FF' to be interpreted properly.

Each sqlcode has a corresponding message in message file QSQLMSGin library QSYS.For negative SQLCODEs and positive SQLCODEs other than +100, the corresponding message for the SQLCODE will be put in the job log. In addition, messages about how a statement ran are also put in the job log when running in debug mode. An ARD program can determine if the application is running in debug mode by using the debug APIs. The message ID is constructed by appending the absolute value (5 digits) of the sqlcode to SQ and changing the third character to L if the third character is a zero. For example, if the sqlcode is -501, the message identifier is SQL0501. Each message may optionally have replacement variables. These variables are placed in the sqlerrmc field of the SQLCA in the previous paragraph. A Display Message Description (DSPMSGD) command or format RTVM0300 of the Retrieve Message (QMHRTVM) API can be used to determine the correct length and type for replacement variables for a particular message. The sqlerrmc field for a message should be built up according to the field data for that message. Refer to SQLCODEs and SQLSTATEs in the DB2 UDB for iSeries SQL Programming topic in the Information Center for more information about SQLCODEs, SQLSTATEs, and their meaning.

CCSID
OUTPUT; BINARY(4)

The CCSID of the sqlerrm, sqlerrp, and sqlwarn fields in the SQLCA.

Output format
OUTPUT; CHAR(*)

The format of the information passed from the ARD program. The following table identifies the formats that the ARD program must return for each of the input format name values that the system will pass to it.

Relationship between Input Format Name and Output Format

Input Format Name Output Format
ARCN0100 See Output Connect Format.
ARDI0100 No output format.
ARBB0100 No output format.
ARBS0100 No output format.
AREB0100 No output format.
ARPS0100 No output format.
ARPD0100 See SQLDA.
ARXD0100 See Output Execute Format.
ARXB0100 Update performed (see the description following this table).
ARXP0100 Update performed (see the description following this table).
ARXI0100 Update performed (see the description following this table).
AROC0100 See Output Open Cursor Format.
ARFC0100 See Output Fetch Cursor Format.
ARCC0100 No output format.
ARDS0100 See SQLDA.
ARDT0100 See SQLDA.

Update performed. CHAR(1)

An indicator of whether the statement resulted in an update. An update is any operation that results in a change to an object such that the object is under commitment control. Valid values follow:

0 The operation did not result in an update.
1 Update occurred from the operation.

Length of output format
OUTPUT; BINARY(4)

The length of the output format in bytes. This must be zero for the following input format names: ARDI0100, ARBB0100, ARBS0100, AREB0100, ARPS0100, and ARCC0100.


Input Format Structures

In the following structures, the CCSID of the character fields is the job CCSID unless a specific CCSID field is included in the format for the field.


Format ARCN0100 (Connect Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(10) Device name
36 24 CHAR(8) Mode name
44 2C CHAR(8) Remote location name
52 34 CHAR(8) Local location name
60 3C CHAR(8) Remote network identifier
68 44 CHAR(8) TPN name
76 4C CHAR(10) User ID
86 56 CHAR(10) Password
96 60 CHAR(8) Product identifier


Field Descriptions for Format ARCN0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

Device name. The device name that is specified in the directory entry. This will be blank if RMTLOCNAME(*ARDPGM) is specified for the RDB directory entry.

Local location name. The local location name that is specified in the directory entry. This will be blank if RMTLOCNAME(*ARDPGM) is specified for the RDB directory entry.

Mode name. The mode name that is specified in the directory entry. This will be blank if RMTLOCNAME(*ARDPGM) is specified for the RDB directory entry.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter for a description of the output format associated with this input format.

Password. The password that the application or user specified on the CONNECT statement. This field is blank if no password is specified. The system does not verify that this password is correct.

Product identifier. The product identifier for the local database in the form QSQvvrrm, where:

For example, if the local database is Version 3 Release 1 Modification 0 of DB2/400, the product identifier is QSQ03010.

RDB name. The name of the relational database that the request was directed to.

Remote location name. The remote location name that is specified in the RDB directory entry. This will be *ARDPGM if RMTLOCNAME(*ARDPGM) is specified for the RDB directory entry.

Remote network identifier. The remote network identifier that is specified in the directory entry. This will be blank if RMTLOCNAME(*ARDPGM) is specified for the RDB directory entry.

TPN name. The transaction program name that is specified in the directory entry. This will be blank if RMTLOCNAME(*ARDPGM) is specified for the RDB directory entry.

User ID. The user identifier that the application or user specified on the CONNECT statement. This field is blank if no user ID is specified.


Format ARDI0100 (Disconnect Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(2) Reserved
28 1C BINARY(4) Disconnect type


Field Descriptions for Format ARDI0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

Disconnect type. The system will set this field to indicate the type of disconnection that is being performed. Values passed follow:

1 Disconnection is occurring because the application performed a DISCONNECT statement for only the relational database that the ARD program is associated with or the application was compiled with the RDB connection method of *RUW and it performed a CONNECT. If the ARD program returns a negative SQLCODE, the disconnection fails and the connection is not ended. The system will never pass this value to the ARD program if the ARD program indicated the conversation uses a protected conversation on the ARCN0100 format.
2 Disconnection is occurring because a DISCONNECT ALL was performed by the application or because all connections for the activation group are ending by an implicit disconnection. Regardless of the SQLCODE value returned by the ARD program, the connection will be ended. The system will never pass this value to the ARD program if the ARD program indicated that the conversation uses a protected conversation on the ARCN0100 format.
3 Disconnection is occurring as part of a commit or rollback. The connection is ending for one of the following reasons:
  • The connection was released and a commit is being performed.
  • The SQL application ended.
  • The activation group ended.
  • An error was detected during an earlier call to the ARD program. The connection had pending changes.
4 Disconnection is occurring because an error was detected during an earlier call to the ARD program. Regardless of the SQLCODE value returned by the ARD program, the connection will be ended.

Output format buffer size. The amount of storage allocated for the output format that is returned by theARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter for a description of the output format associated with this input format.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.


Format ARBB0100 (Begin Package Bind Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) CCSID
76 4C CHAR(1) Existence required
77 4D CHAR(1) Errors allowed
78 4E CHAR(1) Replace allowed
79 4F CHAR(1) String delimiter
80 50 CHAR(1) Decimal delimiter
81 51 CHAR(1) Blocking type
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 CHAR(18) Default collection
130 82 CHAR(50) Text


Field Descriptions for Format ARBB0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

Blocking type. An indicator of when blocking should be performed for read-only cursors in the program. This value may be overridden on the call to the ARD program with the AROC0100 format when the cursor is opened. Values passed follow:

0 Blocking is never performed.
1 Blocking is only performed for cursors declared FOR FETCH ONLY or if there are no dynamic statements or positioned UPDATE or DELETE statements for the cursor.
2 Blocking is performed as long as the cursor is not declared FOR UPDATE and there are no positioned UPDATE or DELETE statements for the cursor.

CCSID. The CCSID of the text. This will always be set to 500.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

Default collection. The name of the collection identifier that is used for the unqualified names of the tables, views, indexes, and SQL packages. This parameter applies only to static SQL statements. A special value of *NONE indicates no default collection.

Errors allowed. Whether errors are allowed. Values passed follow:

0 All statements are checked for correct syntax and semantics. If any error occurs, the package should not be created. When processing the AREB0100 format and an error occurs, the ARD program should return a negative sqlcode for any statement in error. When the AREB0100 format is processed, the ARD program should return a negative sqlcode.
1 Even if errors occur while processing the statements, the package should be created. Reserved sections should be generated for statements in error. When processing the ARBS0100 format and an error occurs, the ARD program should return a negative sqlcode for any statement in error. However, when processing the AREB0100 format, the ARD program should return a non-negative sqlcode.

Existence required. Whether existence of and authority to an object is required. Values passed follow:

0 The absence of an object or lack of authority to an object is not treated as an error. When processing the ARBS0100 format and an object is not found or an authority error occurs, a non-negative sqlcode should be returned from the ARD program in the SQLCA parameter.
1 The absence of an object or lack of authority to an object is treated as an error. When processing the ARBS0100 format and an object is not found or an authority error occurs, a negative sqlcode should be returned from the ARD program in the SQLCA parameter.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted
Uncommitted changes in other jobs can be seen.
*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted
A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.
*ALL The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted
Uncommitted changes in other jobs cannot be seen.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that is being created. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that is being created. Refer to Consistency Token for a description of this field.

Package name. The name of the package that is being created.

RDB name. The name of the relational database that the request was directed to.

Replace allowed. Whether the package can be replaced. Values passed follow:

0 The SQL package is not created if the SQL package of the same name already exists in the specified collection. When processing the AREB0100 format and the package with the same name already exists, the ARD program returns a negative sqlcode.
1 The SQL package is created and any existing SQL package of the same name in the specified collection replaced. The authorities for the existing SQL package are kept for the new SQL package.

Reserved. An ignored field.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" " The character used as the string delimiter is the quotation mark (").

Text. Text that briefly describes the packages function.

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Format ARBS0100 (Bind Statement for Package Creation Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 BINARY(4) Offset to SQLDA
84 54 BINARY(4) Length of SQLDA
88 58 BINARY(4) Offset to SQL statement
92 5C BINARY(4) Length of SQL statement
CHAR(*) SQLDA
CHAR(*) SQL statement

Field Descriptions for Format ARBS0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the statement text.

Length of SQLDA. The length of the SQLDA structure that describes the host variables that are used on the statement. If zero, no host variables were used on the statement.

Length of SQL statement. The length of the SQL statement as contained in the program.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Offset to SQLDA. The offset from the start of the input format structure to the SQLDA structure that describes the host variables that are used on the statement. If zero, no host variables were used on the statement.

Offset to SQL statement. The offset from the start of the input format structure to the SQL statement as contained in the program.

Package collection. The collection for the package being created. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package being created. Refer to Consistency Token for a description of this field.

Package name. The name of the package being created.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number of the statement. Refer to Section Number for a description of this field.

SQLDA. An SQLDA structure that describes the host variables that are used on the statement. The SQLDA structure is described in SQLDA. The SQLDATA and SQLIND pointers are set to NULL for package creation.

SQL statement. The SQL statement as contained in the program except that :H has been substituted for the host variable identifiers.


Format AREB0100 (End of Package Bind Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Maximum section number


Field Descriptions for Format AREB0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

Maximum section number. The last section number in the package. This value may be greater than the last number passed on a call to the ARD program with format ARBS0100 when section numbers are reserved. Refer to Section Number for more information on section numbers.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package being created. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package being created. Refer to Consistency Token for a description of this field.

Package name. The name of the package being created.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.


Formats ARPS0100 and ARPD0100 (Prepare Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(1) String delimiter
81 51 CHAR(1) Decimal delimiter
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 BINARY(4) Offset to SQL statement
116 74 BINARY(4) Length of SQL statement
120 78 CHAR(18) Statement name
CHAR(*) SQL statement


Field Descriptions for Formats ARPS0100 and ARPD0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the statement text and statement name.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted
Uncommitted changes in other jobs can be seen.
*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.

*ALL The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted

Uncommitted changes in other jobs cannot be seen.


Length of SQL statement. The length of the statement string being prepared.

Offset to SQL statement. The offset from the start of the input format structure to the statement string being prepared.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.

SQL statement. The statement string being prepared.

Statement name. The SQL statement name that is specified on the PREPARE statement.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" The character used as the string delimiter is the quotation mark (").

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Formats ARXD0100 and ARXB0100 (Execute Bound Statement)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(1) String delimiter
81 51 CHAR(1) Decimal delimiter
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 CHAR(18) Default collection
130 82 CHAR(2) Reserved
132 84 BINARY(4) Offset to input SQLDA
136 88 BINARY(4) Length of input SQLDA
140 8C BINARY(4) Offset to SQL statement
144 90 BINARY(4) Length of SQL statement
148 94 BINARY(4) Offset to DECLARE PROCEDURE
152 98 BINARY(4) Length of DECLARE PROCEDURE
156 9C BINARY(4) Offset to procedure name
160 A0 BINARY(4) Length of procedure name
CHAR(*) Input SQLDA
CHAR(*) SQL statement
CHAR(*) DECLARE PROCEDURE statement
CHAR(*) Procedure name


Field Descriptions for Formats ARXD0100 and ARXB0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of statement text.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

DECLARE PROCEDURE statement. The DECLARE PROCEDURE statement as contained in the program that is associated with the statement when the statement is a CALL statement. 1403 class A

Input SQLDA. An SQLDA structure that describes the host variables that are used on the statement. The SQLDA structure is described in the SQLDA.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

Uncommitted changes in other jobs can be seen.

*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.

*ALL The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted

Uncommitted changes in other jobs cannot be seen.


Length of DECLARE PROCEDURE. If the statement being executed is a CALL statement and if 1 was returned for the include bound statements field when the ARD program was called using the ARCN0100 format, this field is the length of the associated DECLARE PROCEDURE statement as contained in the program. If there is no associated DECLARE PROCEDURE statement, the statement is not a CALL statement or if 0 was returned for the include bound statements field, this field is set to zero.

Length of input SQLDA. The length of the SQLDA structure that describes the input host variables that are used on the statement. If zero, no input host variables were used on the statement.

Length of procedure name. If the statement being executed is a CALL statement, this field is the length of the procedure name. Otherwise, this field is set to zero.

Length of SQL statement. If the value 1 was returned for the include bound statements field when the ARD program was called using the ARCN0100 format, this field is the length of the statement as contained in the program. Otherwise, this field is set to zero.

Offset to DECLARE PROCEDURE. If the statement being executed is a CALL statement and if 1 was returned for the include bound statements field when the ARD program was called using the ARCN0100 format, this field is the offset of the associated DECLARE PROCEDURE statement as contained in the program. If there is no associated DECLARE PROCEDURE statement, the statement is not a CALL statement, or if 0 was returned for the include bound statements field, this field is set to zero.

Offset to input SQLDA. The offset from the start of the input format structure to the SQLDA structure that describes the input host variables that are used on the statement. If zero, no input host variables were used on the statement.

Offset to procedure name. If the statement being executed is a CALL statement, this field is the offset from the start of the input format structure to the procedure name as contained in the CALL statement. Otherwise, this field is set to zero.

Offset to SQL statement. If 1 was returned for the include bound statements field when the ARD program was called using the ARCN0100 format, this field is the offset from the start of the input format structure to the SQL statement as contained in the program. Otherwise, this field is set to zero.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

Procedure name. If the statement being executed is a CALL statement, this field contains the procedure name as specified in the CALL statement.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number the statement is associated with. Refer to Section Number for more information on section numbers.

SQL statement. The statement as contained in the program.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" The character used as the string delimiter is the quotation mark (").

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Format ARXP0100 (Execute Prepared Statement)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(1) String delimiter
81 51 CHAR(1) Decimal delimiter
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 BINARY(4) Offset to SQLDA
116 74 BINARY(4) Length of SQLDA
120 78 BINARY(4) Offset to procedure name
124 7C BINARY(4) Length of procedure name
128 80 CHAR(18) Statement name
CHAR(*) SQLDA
CHAR(*) Procedure name


Field Descriptions for Format ARXP0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of statement name.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

Uncommitted changes in other jobs can be seen.

*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.

*ALL The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted

Uncommitted changes in other jobs cannot be seen.


Length of procedure name. If the statement being executed is a CALL statement, this field is the length of the procedure name. This field will always be set to 0; it is reserved for future use.

Length of SQLDA. The length of the SQLDA structure that describes the host variables that are used on the statement. If zero, no host variables were used on the statement.

Offset to procedure name. If the statement being executed is a CALL statement, this field is the offset from the start of the input format structure to the procedure name as contained in the CALL statement. This field will always be set to 0; it is reserved for future use.

Offset to SQLDA. The offset from the start of the input format structure to the SQLDA structure that describes the host variables that are used on the statement. If zero, no host variables were used on the statement.

Output format buffer size. The amount of storage allocated for the output format that is returned by theARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

Procedure name. If the statement being executed is a CALL statement, this field contains the procedure name as specified in the CALL statement. This field will not be passed; it is reserved for future use.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.

SQLDA. An SQLDA structure that describes the host variables that are used on the statement. The SQLDA structure is described in the SQLDA.

Statement name. The SQL statement name that is specified on the EXECUTE statement.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" The character used as the string delimiter is the quotation mark (").

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Format ARXI0100 (Execute Immediate Statement Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(1) String delimiter
81 51 CHAR(1) Decimal delimiter
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 BINARY(4) Offset to SQL statement
116 74 BINARY(4) Length of SQL statement
CHAR(*) SQL statement


Field Descriptions for Format ARXI0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the statement text.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

Uncommitted changes in other jobs can be seen.

*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.

*ALL The following are locked until the end of the unit of work (transaction):
  • referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted

Uncommitted changes in other jobs cannot be seen.


Length of SQL statement. The length of the SQL statement to execute.

Offset to SQL statement. The offset from the start of the input format structure to the SQL statement to execute.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.

SQL statement. The SQL statement to execute.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" The character used as the string delimiter is the quotation mark (").

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Format AROC0100 (Open Cursor Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(1) String delimiter
81 51 CHAR(1) Decimal delimiter
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 CHAR(18) Default collection
130 82 CHAR(1) Blocking allowed
131 83 CHAR(1) Reserved
132 84 BINARY(4) Offset to SQLDA
136 88 BINARY(4) Length of SQLDA
140 8C BINARY(4) Offset to DECLARE CURSOR
144 90 BINARY(4) Length of DECLARE CURSOR
148 94 CHAR(18) Cursor name
CHAR(*) SQLDA
CHAR(*) DECLARE CURSOR statement


Field Descriptions for Format AROC0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

Blocking allowed. Whether blocking should be performed for the cursor. Values passed follow:

0 Blocking is not allowed.
1 Blocking is allowed.

CCSID. The CCSID of the statement text and cursor name.

Cursor name. The cursor name that is specified on the OPEN statement.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

DECLARE CURSOR statement. The DECLARE CURSOR statement as contained in the program that is associated with the OPEN statement.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

Uncommitted changes in other jobs can be seen.

*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.

*ALL The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted

Uncommitted changes in other jobs cannot be seen.


Length of DECLARE CURSOR. If 1 was returned for the include bound statements field when the ARD program was called using the ARCN0100 format, this field is the length of the associated DECLARE CURSOR statement as contained in the program. Otherwise, this field is set to zero.

Length of SQLDA. The length of the SQLDA structure that describes the host variables that are used on the statement. If zero, no host variables were used on the statement.

Offset to DECLARE CURSOR. If 1 was returned for the include bound statements field when the ARD program was called using the ARCN0100 format, this field is the offset of the associated DECLARE CURSOR statement as contained in the program. Otherwise, this field is set to zero.

Offset to SQLDA. The offset from the start of the input format structure to the SQLDA structure that describes the host variables that are used on the statement. If zero, no host variables were used on the statement.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.

SQLDA. An SQLDA structure that describes the host variables that are used on the statement. The SQLDA structure is described in the SQLDA.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" The character used as the string delimiter is the quotation mark (").

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Format ARFC0100 (Fetch from a Cursor Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(1) String delimiter
81 51 CHAR(1) Decimal delimiter
82 52 CHAR(10) Date format
92 5C CHAR(10) Time format
102 66 CHAR(10) Isolation level
112 70 CHAR(18) Cursor name


Field Descriptions for Format ARFC0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the cursor name.

Cursor name. The cursor name that is specified on the FETCH statement.

Date format. The format that is used when the exit program accesses date result columns. Values passed follow (where m=month, d=day, and y=year):

*USA The United States date format mm/dd/yyyy.
*ISO The International Organization for Standardization (ISO) date format yyyy-mm-dd.
*EUR The European date format dd.mm.yyyy.
*JIS The Japanese Industrial Standard date format yyyy-mm-dd.

Decimal delimiter. The statement decimal delimiter for the SQL statements. Values passed follow:

. The value used as the decimal point in numeric literals is a period.
, The value used as the decimal point in numeric literals is a comma.

Isolation level. The level of record locking that occurs under commitment control. Values passed follow:

*CHG The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

Uncommitted changes in other jobs can be seen.

*CS The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are updated, deleted, and inserted

A row that is selected but not updated is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.

*ALL The following are locked until the end of the unit of work (transaction):
  • Objects that are referred to in SQL ALTER, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, and REVOKE statements
  • Rows that are selected, updated, deleted, and inserted

Uncommitted changes in other jobs cannot be seen.


Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.

String delimiter. The statement string delimiter for the SQL statements. Values passed follow:

' The character used as the string delimiter is the apostrophe (').
" The character used as the string delimiter is the quotation mark (").

Time format. The format that is used when the exit program accesses time result columns. Values passed follow (where h=hour, m=minute, and s=second):

*USA The United States time format hh:mm xx is used, where xx is A.M. or P.M.
*ISO The International Organization for Standardization (ISO) time format hh.mm.ss.
*EUR The European time format hh.mm.ss.
*JIS The Japanese Industrial Standard time format hh:mm:ss.


Format ARCC0100 (Close a Cursor Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(18) Cursor name


Field Descriptions for Format ARCC0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the cursor name.

Cursor name. The cursor name specified on the CLOSE statement.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.


Format ARDS0100 (Describe a Statement Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(18) Package collection
44 2C CHAR(18) Package name
62 3E CHAR(8) Package consistency token
70 46 CHAR(2) Reserved
72 48 BINARY(4) Section number
76 4C BINARY(4) CCSID
80 50 CHAR(18) Statement name


Field Descriptions for Format ARDS0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the statement name.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

Package collection. The collection for the package that the statement is associated with. A collection is a name that provides a logical grouping for SQL objects.

Package consistency token. The consistency token for the package that the statement is associated with. Refer to Consistency Token for a description of this field.

Package name. The name of the package that the statement is associated with.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.

Section number. The section number that the statement is associated with. Refer to Section Number for more information on section numbers.

Statement name. The statement name that is specified on the DESCRIBE statement.


Format ARDT0100 (Describe Object Format)

Offset Type Field
Dec Hex
0 0 BINARY(4) Output format buffer size
4 4 BINARY(4) Activation group number
8 8 CHAR(18) RDB name
26 1A CHAR(2) Reserved
28 1C BINARY(4) CCSID
32 20 BINARY(4) Offset to object name
36 24 BINARY(4) Length of object name
CHAR(*) Object name


Field Descriptions for Format ARDT0100

Activation group number. The activation group number of the program that is performing the request. See Activation Group for a description of what an activation group is.

CCSID. The CCSID of the object name.

Length of object name. The length of the name of the SQL object to describe.

Object name. The name of the SQL object to be described. This may be either a qualified or unqualified table name. If it is qualified, it will be in the SQL naming format, that is, a collection name followed by a period and an SQL identifier.

Offset to object name. The offset from the start of the input format structure to the name of the SQL object to describe.

Output format buffer size. The amount of storage allocated for the output format that is returned by the ARD program. The length of the output format must be less than or equal to this value. It must also conform to the description of the output format associated with this input format. See the description of the output format parameter on for a description of the output format associated with this input format.

RDB name. The name of the relational database that the request was directed to.

Reserved. An ignored field.


Output Format Structures

In the following structures, the CCSID of the character fields is the job CCSID unless a specific CCSID field is included in the format for the field.


Output Connect Format

Offset Type Field
Dec Hex
0 0 CHAR(3) Server product
3 3 CHAR(2) Server version
5 5 CHAR(2) Server release
7 7 CHAR(1) Server level
8 8 CHAR(10) User ID
18 12 CHAR(1) Include bound statements
19 13 CHAR(1) Protected conversation


Field Descriptions for Output Connect Format

Include bound statements. Whether statements that were sent at package-creation time should be included in run-time formats ARXD0100, ARXB0100, and AROC0100. Valid values follow:

0 Do not include bound statements.
1 Include bound statements.

Protected conversation. Whether a protected conversation is used for the connection. If the connection uses a protected conversation, the system rejects attempts by the application to run the DISCONNECT SQL statement. Connections that use protected conversations are only ended during commit and rollback processing. See the description of the disconnect type field (page Disconnect type) for format ARDI0100 for more information. Valid values follow:

0 Conversation is not protected.
1 Conversation is protected.

Server level. An identifier for the level of the database server that is accessed by the ARD program. This value must be a character representation of a hexadecimal value. That is, it may only consist of the characters 0-9 and A-F.

Server product. An identifier for the database server that is accessed by the ARD program. The system does no verification of the value of this field.

Server release. An identifier for the release of the database server that is accessed by the ARD program. This value must be a character representation of a hexadecimal value. That is, it may only consist of the characters 0-9 and A-F.

Server version. An identifier for the version of the database server that is accessed by the ARD program. This value must be a character representation of a hexadecimal value. That is, it may only consist of the characters 0-9 and A-F. The system does no verification of the value of this field.

User ID. The user ID that is used at the server.


Output Execute Format

Offset Type Field
Dec Hex
0 0 CHAR(1) Update performed
1 1 CHAR(3) Reserved
4 4 BINARY(4) Offset to SQLDA
8 8 BINARY(4) Offset to result set
CHAR(*) SQLDA
CHAR(*) Result set


Field Descriptions for Output Execute Format

Offset to result set. The offset from the start of the output format to the result set. If the SQLCA indicates an error occurred, this field must be set to 0.

Offset to SQLDA. An offset from the start of the output format to the SQLDA structure that describes the columns for the results of the statement. This field can only have a value of 0 or a multiple of 16. If the SQLCA indicates an error occurred, this field must be set to 0. If the SQLCA does not indicate an error, this field cannot be 0.

Reserved. An ignored field.

Result set. The result for the SQL statement. Columns are contiguous with null indicators (if appropriate) that precede the column data. Refer to Query (Fetch) Data Format for more information. If the offset to result set field is 0, this field must not be included in the output format.

Note: This null indicator is not the same as the NULL in the C language.

SQLDA. An SQLDA structure that describes the columns for the results of the statement. The SQLDA structure is described in SQLDA. If the offset to SQLDA field is 0, this field must not be included in the output format.

Update performed. Whether the statement resulted in an update. An update is any operation that results in a change to an object such that the object is under commitment control. Valid values follow:

0 The operation did not result in an update.
1 An update occurred from the operation.


Output Open Cursor Format

Offset Type Field
Dec Hex
0 0 CHAR(1) Block data
1 1 CHAR(1) Cursor held
1 1 CHAR(2) Reserved
4 4 BINARY(4) Offset to SQLDA
CHAR(*) SQLDA


Field Descriptions for Output Open Cursor Format

Block data. Whether the ARD program will block the data. Valid values follow:

0 A single row of data will be returned.
1 Data will be returned in blocks.

Cursor held. Whether the cursor is held open after commits. Valid values follow:

0 Cursor is closed after commits.
1 Cursor is held open after commits.

Offset to SQLDA. The offset from the start of the output format to the SQLDA structure that describes the columns for the results of the statement. This field can only have a value of 0 or a multiple of 16. If the SQLCA indicates that an error occurred, this field must be set to 0. If the SQLCA does not indicate an error, this field cannot be 0.

Reserved. An ignored field.

SQLDA. An SQLDA structure that describes the columns for the results of the statement. The SQLDA structure is described in SQLDA. If the offset to SQLDA field is 0, this field must not be included in the output format.


Output Fetch Cursor Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Offset to result set
4 4 CHAR(1) Cursor closed
CHAR(*) Result set


Field Descriptions for Output Fetch Cursor Format

Cursor closed. Whether the cursor is closed. Valid values follow:

0 The cursor is open.
1 The cursor is closed.

Offset to result set. The offset from the start of the output format to the result set. If no data is returned, this field should be set to 0.

Result set. The result for the SQL statement. Columns are contiguous with null indicators (if appropriate) that precede the column data. Refer to Query (Fetch) Data Format for more information. If the offset to result set field is 0, this field must not be included in the output format.

Note: This null indicator is not the same as the NULL in the C language.


Activation Group

An activation group provides the following:

Connections are scoped to the activation group. Therefore, the activation group mark and the RDB name together are used to uniquely identify the connection. It is not possible to have more than one connection active with the same RDB name in the same activation group at a point in time. However, it is possible to have multiple connections with different RDB names in the same activation group and to have multiple connections with the same RDB name in different activation groups.


Consistency Token

The system associates a consistency token with every program. If a program is compiled again, a new consistency token is created. When a user or application creates a package with the CRTSQLxxx commands or the CRTSQLPKG command and an RDB that is associated with an ARD program is specified on the command, the package consistency token from the program along with a package name and package collection is passed to the ARD program. In addition, at program run time, the ARD program will be passed the package name, package collection, and package consistency token that are currently associated with the program.

The ARD program can use this information passed to it during run time to verify that information passed to it during package creation is correct for the instance of the program being run. If a package does not exist for the given package consistency token, package name, and package collection, the exit program should return messages SQLCODE (-805) and SQLSTATE (51002).


Section Number

When a user or application creates a package with the CRTSQLxxx commands or the CRTSQLPKG command and an RDB that is associated with an ARD program is specified on the command, statements contained in the program are passed to the ARD program. A section number is associated with the statements. A section number is a signed binary number ranging from 1 to 32767. Section numbers may not necessarily be consecutive.

Related statements share the same section numbers. Therefore, a cursor declared for a statement and each statement that references the declared statement or cursor (FETCH, EXECUTE, OPEN, CLOSE, PREPARE) have the same section number. However, each uniquely declared statement or cursor has a different section number.

The system assigns a unique section number to the following statements and any other statements that it does not understand:

The following statements are not passed to the ARD program during the package creation process. Also, local statements that are understood by the precompiler but do not result in calls to the ARD program at run time are not passed.


Query (Fetch) Data Format

Query data is returned as a continuous collection of columns. Multiple rows of data may also be returned for format ARFC0100 when the ARD program returned 1 for the block data field on format AROC0100. When multiple rows of data are returned, the rows are also contiguous.

If a column is a null-capable or a derived field (for example COL1/COL2), the column data is preceded with a 1-byte null indicator. The length of data returned for variable-length data types should be based on the length in the length indicator. It should not be padded to the length of the field. Representation of all data types is assumed to be in the format used by i5/OS.

The null indicator is a 1-byte signed binary integer. If the null indicator is negative (between X'80' and X'FF', inclusive), no column data should follow the indicator. For data conversion errors, -2 (X'FE') should be used for the null indicator.

If a data conversion error occurs and the column is non-null-capable, an error sqlcode should be returned in the SQLCA. When an error (negative SQLCODE) is indicated in the SQLCA and the ARD program is not returning multiple rows, no data should be returned. When multiple rows of data are being returned for a query and the ARD program returns an error in the SQLCA, the row that the error applies to should not be included in the block and the row previous to the row in error should be the last row returned.

When a warning (positive SQLCODE) is indicated in the SQLCA and the ARD program is not returning multiple rows, the row should be returned. When multiple rows of data are being returned for a query and an ARD program returns a warning in the SQLCA, the row that the warning applies to should be the last row in the block.

If the ARD program has not indicated that the cursor is closed in the cursor closed field of the output format for ARFC0100, the system will call the ARD program to get additional rows when the application requests a row after the row that the warning or error applies to. If the ARD program indicated the cursor was closed, the system will not call the ARD program for that cursor again until the application performs another SQL OPEN.

The following illustration shows an example of two rows of data being returned for a FETCH. The two rows each consist of a null-capable smallint COL1, a non-null-capable CHAR(3) COL2, a null-capable smallint COL3, and a non-null-capable VARCHAR(20) COL4.

Hex Representation             Description
00                    Row 1 - Null byte for COL1 - not null
0001                  Row 1 - COL1 (smallint) value = 1
D1E6E3                Row 1 - COL2 (CHAR(3)) value =  JWT
FF                    Row 1 - Null byte for COL3 - null
0007D1C5C6C6D9C5E8    Row 1 - COL4 Length = 7 value = JEFFREY
FF                    Row 2 - Null byte for COL1 - null
D1D4C2                Row 2 - COL2 (CHAR(3)) value =  JMB
00                    Row 2 - Null byte for COL3 - not null
0002                  Row 2 - COL3 (smallint) value = 2
0004D1D6C8D5          Row 1 - COL4 Length = 4 value = JOHN

In response to format ARXD0100 when data is returned for a CALL statement, a null indicator must precede each field regardless of whether the field is null-capable or not. For any parameters declared as input-only on the DECLARE PROCEDURE statement, the null indicator must be set to X'80'.

The following illustration shows an example of the data returned for a CALL where the first parameter was an input-only parameter and the second was an output smallint.

Hex Representation            Description
80                    Parm 1 - Null byte - input only
00                    Parm 2 - Null byte - not null
0001                  Parm 2 - Value = 1

SQLDA

An SQLDA is a set of variables that describe either host variables or column attributes. Included in this topic are the SQLDA structure, the relevant settings for those fields that the ARD program returns to the operating system, and the relevant fields that are passed to the ARD program.

For more information about SQLDA, see SQL Descriptor Area (SQLDA) in the DB2 UDB for iSeries SQL Reference topic.

The SQLDA has the following fields (shown in C-language format):

struct sqlda
{
    unsigned char  sqldaid[8];
    long           sqldabc;
    short          sqln;
    short          sqld;
    struct sqlvar
    {
        short         sqltype;
        short         sqllen;
        unsigned char sqlres[12];
        unsigned char *sqldata;
        short         *sqlind;
        struct sqlname
        {
            short        length;
            unsigned char data[30];
        } sqlname;
    } sqlvar[1];
};

In response to the ARPD0100, ARDS0100, and ARDT0100 formats, the following fields must be set on the return from the ARD program:

sqldaid An eye-catcher for diagnostic purposes. This must be set to 'SQLDA'.
sqldabc The length of the SQLDA. Its value is calculated as '2*sqld*sizeof(sqlvar) + 16'.
sqld A number equal to the number of columns described. The actual number of sqlvar occurrences returned should be twice this number. If the statement being described is not a SELECT statement, this field is set to 0.
sqlvar A structure that contains two entries for each column in the result table. If nis the number of columns being described, the first n sqlvar entries contain the following:
sqltype The sqltype of the column in the select list of the result table. See the DB2 UDB for iSeries SQL Reference topic for a complete list of field data types and their corresponding sqltype value.
sqllen The length attribute of the column.
sqldata For character data, the CCSID of the field in the following format: bytes 1 and 2 are set to X'00' and bytes 3 and 4 are set to the CCSID value.
sqlind Reserved. This must be set to X'00'.
sqlname The unqualified name of the column.
sqlname.length The length of the unqualified name of the column.
sqlname.data The unqualified column name. The CCSID of the value is the CCSID of the job.

And the second n entries contain the following:

sqltype Reserved. This must be set to X'00'.
sqllen Reserved. This must be set to X'00'.
sqldata Reserved. This must be set to X'00'.
sqlind Reserved. This must be set to X'00'.
sqlname The label of the column.
sqlname.length The length of the column label.
sqlname.data The column label. The CCSID of the value is the CCSID of the job.

In response to formats AROC0100 and ARXD0100, the following fields must be set on the return from the ARD program:

sqldaid An eye-catcher for diagnostic purposes. This must be set to 'SQLDA'.
sqldabc The length of the SQLDA. Its value is calculated as 'sqld*sizeof(sqlvar) + 16'.
sqld The number of columns in the result table.
sqlvar A structure that contains an entry for each column in the result table. The entries contain the following fields:
sqltype The sqltype of the column in the select list of the result table. See the DB2 UDB for iSeries SQL Reference topic for a complete list of field data types and their corresponding sqltype value.
sqllen The length attribute of the column.
sqldata For character data, the CCSID of the field in the following format: bytes 1 and 2 are set to X'00' and bytes 3 and 4 are set to the CCSID value.
sqlind Reserved. This must be set to X'00'.
sqlname The unqualified name of the column.
sqlname.length The length of the unqualified name of the column.
sqlname.data The unqualified column name. The CCSID of the value is the CCSID of the job.

On input to the ARD program on formats ARBS0100, ARXD0100, ARXB0100, ARXP0100, and AROC0100, the ARD program must interpret the SQLDA because it describes host variables to be used with the statement. The relevant fields are:

sqld The number of host variables for the statement.
sqlvar A structure that contains one entry for each host variable. The entries contain the following:
sqltype The sqltype of the host variable. See the DB2 UDB for iSeries SQL Reference topic for a complete list of field data types and their corresponding sqltype value. An odd value for sqltype indicates that this sqlvar entry contains a pointer to an indicator variable that is addressed by sqlind.
sqllen The length attribute of the host variable.
sqldata A pointer to the host variable data. This field is set to NULL for format ARBS0100.
sqlind A pointer to an indicator variable. The indicator variable is a 2-byte binary value that signifies a NULL value when sqlind is set to a negative value. This field is only relevant if the sqltype field is odd. This field is set to NULL for format ARBS0100.
sqlname The coded character set identifier (CCSID) for character host variables.
sqlname.data The CCSID of the field in the following format: bytes 1 and 2 are set to X'00' and bytes 3 and 4 are set to the CCSID value.
sqlname.length This field is set to 8.


Commit APIs

To process commit and rollback requests, providers of ARD programs must register a commitment control resource. Refer to Commit APIs for more information on the commitment control APIs. The following section assumes an understanding of the commit APIs.

The Add Commitment Resource (QTNADDCR) API should be called to add a commitment resource to a commitment definition. After the resource is added, the exit program specified on the Add Commitment Resource API is called during commitment control operations for the commitment definition. When registering commitment resources for use with ARD programs, the commitment resource should be added after the first successful operation after the ARCN0100 format call. It is best not to perform this operation as part of the ARCN0100 format call since once a commitment control API resource is registered, the commitment definition is no longer at a logical unit-of-work boundary. A CONNECT operation does not normally change the logical unit-of-work boundary of a commitment definition. If a commitment resource is registered during the ARCN0100 format call, the create SQL package (CRTSQLPKG) function fails.

The Remove Commitment Resource (QTNRMVCR) API should be called to remove a resource from a commitment definition. This API should be called after processing the ARDI0100 format call. It cannot be called during the ARDI0100 format call if the ARDI0100 format indicates that the disconnection is occurring as part of a commit or rollback. A disconnect type of 3 indicates that the disconnect is occurring as part of a commit or rollback. In this situation, the commit resource should be removed either during the next SQL operation the ARD program processes or during the next commit or rollback operation. In the latter case, the commitment control exit program can have the resource removed by using the changes ended field in the return information format. Until this resource is removed, the Create SQL Package (CRTSQLPKG) command will fail.


Exit program introduced: V3R6
Top | Database and File APIs | APIs by category