Profile Table
profile_tableProfile DB2 for i tables for ETL by returning row counts, deleted rows, size, last change, and column distinct/null counts with value ranges; optionally scan up to 20 columns for exact stats.
Instructions
Profile a table for ETL work: row count, deleted rows, size, and last change from QSYS2.SYSTABLESTAT, plus per-column distinct count, null count, and low and high values. By default column numbers come from stored statistics in QSYS2.SYSCOLUMNSTAT (low and high are the second-lowest and second-highest values), and columns without collected statistics report source "none". Set compute to true to scan the table for exact numbers on up to 20 columns. Masked columns keep their counts and return no values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name | |
| schema | No | Schema (library) that contains the table. Uses the system's default schema if not provided. | |
| columns | No | Columns to profile. Defaults to every column (the first 20 when compute is true). | |
| compute | No | Scan the table for exact counts, MIN, and MAX. Slower on large tables. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | ||
| data | No | ||
| mode | No | ||
| cause | No | Why the statement failed. &1-style placeholders stand for values in error. | |
| count | No | ||
| error | No | ||
| table | No | ||
| schema | No | ||
| sqlcode | No | SQLCODE of the failed statement, such as -204 | |
| success | Yes | ||
| recovery | No | What to change before trying again | |
| sqlstate | No | SQLSTATE of the failed statement | |
| truncated | No | ||
| table_stats | No | ||
| computed_rows | No |