LISTCOLUMNS view
The DVSYS.LISTCOLUMNS view displays the list of columns of the tables in a RDBMS source.
Before you begin
SELECT
* FROM DVSYS.LISTCOLUMNS WHERE CID= ?).- Table retrieval limit
- Only the first 10,000 rows are retrieved by default. To access tables beyond this initial batch,
use the FILTER predicate to narrow down the schema, table and column filter to retrieve the columns
of interest. See the FILTER column in the following
table for more information.
Alternatively, you can increase the number of rows retrieved by modifying the configuration property
BATCHSIZE_FOR_LISTSCHEMAS_OR_LISTTABLES, although this might negatively impact the performance. - Timeout and concurrency limits
- The data source API calls for
LISTSCHEMAS,LISTTABLES, andLISTCOLUMNSwhich are subject to a configurable timeout defined by theSOURCE_CATALOG_API_GETCOLUMNS_TIMEOUT_MSproperty, with a default value of 5 minutes. Additionally, the maximum number of concurrent calls is controlled by theSOURCE_CATALOG_API_MAX_CONCURRENCYproperty, which defaults to 4. Incoming requests that exceed this concurrency limit will not be processed and will return no rows.Note: For multiple catalog sources, theRELOADTABLES_ALLCOLS_<CID>property defines the default catalog used unless the FILTER predicate and the catalog is defined. For example:<catalog>,null,null,null).To define the FILTER, run this view and ensure you replace<xxxx...>with CID and FILTER values.SELECT * FROM DVSYS.LISTCOLUMNS WHERE CID='<xxxx>' and FILTER='<xxxxxx>'The data source API returns the value in the JDBC API
DatabaseMetaadata.getColumns()columns.
| Column | Type | Description |
|---|---|---|
| CID | VARCHAR(20) | The connection identifier. This is a required input predicate in the form of a string constant. |
| FILTER | VARCHAR(500) | The optional input predicate you use when calling LISTCOLUMNS to enable pushdown operations.
This predicate is in the form of a string constant. Composite CSV input string with same format as
used for the properties
|
| TCATALOG | VARCHAR(128) | The catalog name. |
| TSCHEM | VARCHAR(128) | The schema name. |
| TNAME | VARCHAR(128) | The table name. |
| TCOLUMN | VARCHAR(20) | The name of the table column. |
| DATA_TYPE | SMALLINT | The returned data type in the form of java.sql.Types. |
| TYPE_NAME | VARCHAR(80) | The type name for the DATA_TYPE column value. |
| COLUMN_SIZE | INT | The size of the column.
|
| DECIMAL_DIGITS | SMALLINT | The number of fractional digits. |
| NUM_PREC_RADIX | SMALLINT | The radix (base) used for the numeric data type. This value can be 2,
10, or NULL. |
| NULLABLE | SMALLINT | Indicates whether NULL values are allowed.
|
| REMARKS | VARCHAR(2000) | Comments describing the column. |
| COLUMN_DEF | VARCHAR(254) | The column definition. |
| CHAR_OCTET_LENGTH | INT | The maximum number of bytes in the column. |
| ORDINAL_POSITION | INT | The index of the column in the table. |
| IS_NULLABLE | VARCHAR(3) | Displays whether the column is nullable. |
| SCOPE_CATALOG | VARCHAR(128) | Defines the catalog name of a table that is referenced by the REF attribute. The value
returns |
| SCOPE_SCHEMA | VARCHAR(128) | Defines the schema name of a table that is referenced by the REF attribute. The value
returns |
| SCOPE_TABLE | VARCHAR(128) | Defines the table name of a table that is referenced by the REF attribute. The value
returns |
| SOURCE_DATA_TYPE | SMALLINT | The source type of a distinct type or user-generated Ref type, the data type is in the form
of java.sql.Types. The value returns |
| IS_AUTOINCREMENT | VARCHAR(3) | Indicates whether this column is auto incremented.
|
| IS_GENERATEDCOLUMN | VARCHAR(3) | Displays whether this is a generated column. This value currently returns
““. |
Example
This example calls getColumns('null','SSPD','DISTTEST%','%') on the remote
Db2 source:
select * from DVSYS.LISTCOLUMNS WHERE CID='DB210001' AND FILTER='null,SSPD,DISTTEST%,%'
CID FILTER TCATALOG TSCHEM TNAME TCOLUMN DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN
DB210321 null,SSPD,DISTTEST%,% SSPD DISTTEST C1 4 INTEGER 10 0 10 1 1 YES
DB210321 null,SSPD,DISTTEST%,% SSPD DISTTEST C2 3 DECIMAL 10 5 10 1 2 YES
DB210321 null,SSPD,DISTTEST%,% SSPD DISTTEST C3 12 VARCHAR 10 1 20 3 YES
DB210321 null,SSPD,DISTTEST%,% SSPD DISTTEST C4 93 TIMESTAMP 29 9 10 1 4 YES Learn more
For more information on BATCHSIZE_FOR_LISTSCHEMAS_OR_LISTTABLES,
SOURCE_CATALOG_API_GETCOLUMNS_TIMEOUT_MS,
SOURCE_CATALOG_API_MAX_CONCURRENCY and
RELOADTABLES_ALLCOLS_<CID>, refer to SETCONFIGPROPERTY properties.