The purpose of each exit is to format or change the value of the CHAR-type values that correspond to Date, Time, and Timestamp columns. The exits are particularly useful if you cannot fulfill your intent by using another mechanism such as JBDC driver properties or DB2 precompiler options.
On input to the database, the content of the host variable is unaffected; only the value sent to the database column is changed. On output, the content of the host variable is changed, but the column value is unaffected.
The exits that are delivered are templates that have no effect.
Record TstabN type SQLRecord
{tableNames = [["ME.MYTABLE"]], fieldsMatchColumns = yes}
10 TS2 char(26) {column="TS2", isSqlNullable=yes, sqlDataCode=392};
10 TS1 char(26) {column="TS1", isSqlNullable=yes, sqlDataCode=392};
10 DATE1 char(10) {column="DATE1", isSqlNullable=yes, sqlDataCode=384};
10 TIME1 char(8) {column="TIME1", isSqlNullable=yes, sqlDataCode=388};
end
dataitem tstype char(26) {sqlDataCode=392} end
dataitem datetype char(10) {sqlDataCode=384} end
dataitem timetype char(8) {sqlDataCode=388} end
Any of the following sqlDataCode values causes an exit invocation:
| sqlDataCode values | Nullable | SQL column type |
|---|---|---|
| 384 385 |
YES NO |
DATE |
| 388 389 |
YES NO |
TIME |
| 392 393 |
YES NO |
TIMESTAMP |
You can set a preference so that use of the EGL SQL retrieve feature automatically places the sqlDataCode values in a Record part that is created for you. For details, see "Setting preferences for SQL retrieve."
The exit for a specific field is not invoked during database input when the field is null, or during database output when the column is null.