Nuances of DECLARE ISPFTABLE Operation

Describes differences in behavior using the DECLARE ISPFTABLE service.
Typically, the number of rows FETCHed and the number of rows that are loaded into a target ISPF table are the same, but not invariably. The FETCH/load counts can differ when the SQL query result contains duplicate values for those SQL result columns that are defined as keyed columns in the ISPF table.
In the following example, six rows are FETCHed from the SQL query result but only three rows are successfully loaded into the target ISPF table. Three of the result row values for column name EMPID were duplicates.
SELECT EMPID, LNAME, FNAME, DEPT FROM EMPLOYEE_TABLE ISPEXEC TBCREATE EMPLOYEE KEYS(DEPT) NAMES(EMPID, LNAME, FNAME) WRITE EMPID DEPT SQL FETCH / ISPF Table load outcome ----- ---- ---------------------------------------------- 00001 A100 <--- first row retrieved / first row loaded 00002 A100 <--- second row retrieved / row load failed 00003 A100 <--- third row retrieved / row load failed 00004 A100 <--- fourth row retrieved / row load failed 00005 A500 <--- fifth row retrieved / second row loaded 00006 A600 <--- sixth row retrieved / third row loaded
You can limit the number of rows which the DECLARE ISPFTABLE service fetches and loads using the
RLX
CONTROL LIMIT service.
The limit check
RLX
performs is made on the number of rows that are loaded rather than the number of rows FETCHed.