Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.fldList() UDTF returns one row for each column (field) in the specified table (file).
The information returned in similar to the WRKIQRY command or the classic IBM i CL command named DSPFFD.
UDF | Return Type | Description |
fldList | TABLE | Returns a resultSet, one row for each column in the specified table. |
iQuery.fldList( library-name, file-name )
The library-name is the name of the library that contains the file-name specified on the second parameter.
The file-name is the name of the file whose fields properties shall be returned.
Column | Type | Description |
COLUMN | varchar(10) | The system column (field) name. |
FILE | varchar(10) | The system table (file) name. |
LIBRARY | varchar(10) | The system schema (library) name. |
DATATYPE | varchar(10) | The data-type of the column The data-type is spelled similar |
LENGTH | INT | Field length (declared length) |
DECPOS | smallint | For numeric fields, the number of decimal positions |
BUFFERSIZE | INT | Number of bytes the field occurpies in the record. |
CCSID | INT | The CCSID of the field. |
HEADING | varchar(60) | The COLHDG or "TEXT IS" headings for the field. |
TEXT | varchar(50) | The field text description. |
LONG_COLUMN_NAME | varchar(128) | The long column name |
LONG_TABLE_NAME | varchar(128) | The long table name |
LONG_SCHEMA_NAME | varchar(128) | The long schema (library) name |
select * from table( iQuery.fldList( 'MYLIB', 'CUSTOMER') ) ffd;