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.depFile() UDTF returns one row for each file dependant on the file name specified. The results are similar to the QDBLDBR API or the DSPDBR CL command.
iQuery.depfile( library, file, member, rcdfmt )
The library is the name of the library that contains the file(s) whose dependent files are to be returned. In addition to a specific library name, the special values *ALL, *ALLUSR, *USRLIBL, *LIBL, and *CURLIB may be specified.
The optional file name is the name of the file whose dependent files are to be returned. A generic or full name may be specified. The default is *ALL.
The optional member name specifies the name of the file's member to be used as the dependent files to be returned. The default is *ALL but *FIRST and *LAST may also be specified.
The optional rcdfmt (record format) name specifies the name of the record format that is used by the dependent files returned.
If only the LIBRARY or LIBRARY and FILE parameters are specified, then a file dependency list is created. If only the FILE parameter is not specified, then the *ALL is used.
If the MEMBER parameter is specified, then a member dependency list is created.
If the RCDFMT parameter is specfied, then a record format sharing dependency list is create.
Column | Type | When Returned | Description |
LIBRARY | varchar(10) | F, M, R | The library name of the file whose dependent information is returned |
FILE | varchar(10) | F, M, R | The name of the file whose dependent information is returned. |
MBR | varchar(10) | M | The member name of the file whose dependent information is returned. |
RCDFMT | varchar(10) | R | The record format name of the file whose dependent information is returned. |
DEPLIBRARY | varchar(10) | F, M R | The library name of the dependent file. |
DEPFILE | varchar(10) | F, M R | The name of the dependent file. |
DEPMBR | varchar(10) | M | The member name of the dependent file. |
DEPTYPE | varchar(16) | F, M | The type of dependency: CONSTRAINT, DATA, ACCPTH, ACCPTH OWNER, SQL VIEW |
CSTLIBRARY | varchar(10) | F, M | The library name containing the Constraint, if any. |
CONSTRAINT | varchar(258) | F, M | The constraint (if any). |
The following creates a list of dependencies for the file named CUSTMAST in library PRODDATA.
select * from table(iQuery.depFile(library => 'PRODDATA', File => 'CUSTMAST')) dbr;
The following creates a list of dependencies for the Member CHICAGO in the file named CUSTSALES in the library PRODDATA.
select * from table(iQuery.depFile(library => 'PRODDATA', File => 'CUSTSALES', member=>'CHICAGO')) dbr;