NUMTABSREMOTE view
The DVSYS.NUMTABSREMOTE view displays the number of tables in a remote RDBMS source.
Before you begin
Consider the following limitations:
- This view does not usually call predicates, but you can use predicates on the
CIDandFILTERcolumns. - Only one thread can call the view at the remote data source at a time.
- The default timeout for calling this view is 5 seconds, which can be configured using the
SOURCE_CATALOG_API_CACHED_FOREGROUND_TIMEOUT_MSproperty. - If calling this view times out, the
NUMTABS_FILTEREDorNUMTABS_TOTALcolumns return-1and the call to the remote source will continue. After the call completes, the cache updates with the new value, which is returned in subsequent NUMTABSREMOTE calls. - If the
NUMTABS_FILTEREDorNUMTABS_TOTALcolumns return-2, then this indicates that the data source connection is experiencing problems.
Note: In the following table, a pushed column refers to a column whose predicate value is used in a
remote query or API running against the remote source to retrieve the total number of tables.
| Column | Type | Description |
|---|---|---|
| CID | VARCHAR(2) | Connection ID of the data source.
|
| FILTER | VARCHAR(500) | The composite CSV string with the same format as used for properties
RELOADTABLES_ALLTABS_<CID> and
RELOADTABLES_ALLCOLS_<CID>:
'<CATALOG>,<SCHEMAPATTERN>,<TABLENAMEPATTERN>,<TABLETYPES>'.
|
| NUMTABS_TOTAL | BIGINT | The total number of tables in the source. Note: If you attempt to run
this view for multiple catalog sources, this column returns an output of -1 as the total number of
tables, and this is expected. For more information, see Running the NUMTABSREMOTE view for
multiple catalog sources returns
-1 as the total number of
tables. |
| NUMTABS_FILTERED | BIGINT | The number of tables in the source when applying filter constraints. If an equality predicate
is specified against column FILTER then that value is used as a filter. Otherwise, the value of the
configuration property is RELOADTABLES_ALLTABS_<CID>. If the value is not
configured then the number will be the same as NUMTABS_TOTAL. |
Example
This example call retrieves the total number of tables.
SELECT * FROM DVSYS.NUMTABSREMOTELearn more
For more information on the SOURCE_CATALOG_API_CACHED_FOREGROUND_TIMEOUT_MS,
RELOADTABLES_ALLTABS_<CID> and RELOADTABLES_ALLCOLS_<CID>
properties, refer to SETCONFIGPROPERTY properties.