SHOW TABLE
Summary
The SHOW TABLE
command returns a result set containing metadata describing the specified table. The metadata includes the table’s schema, columns, and column data types, among others.
Syntax
show table <schema_name>.<table_name>; |
Parameters
Parameter
|
Description
|
---|---|
<schema_name>.<table_name> |
The schema and table name to lookup. |
Details
Many of the columns returned in the command’s result set are for internal use. For example, a column’s xSQL data type must map to a corresponding ODBC data type for use in Xactly’s ODBC driver. Developers and end users will most likely find the command’s schema, table, xSQL data type, and column name, and column precision and scale values most relevant.
You may prefer to use DESCRIBE
to retrieve a less verbose list of a table’s metadata.
The following table lists the columns returned by SHOW TABLE
.
Column Name
|
Data Type
|
Description
|
---|---|---|
id |
integer |
Unique identifier for each column in table |
table_id |
string |
Unique identifier for table |
schema_name |
string |
Table’s schema name |
table_name |
string |
Table’s name |
column_name |
string |
Column name from table |
description |
string |
For future use |
type | integer | Column’s xSQL data type. Refer to SHOW TYPES |
sub_type | integer | For future use |
size | integer | Column’s xSQL data type size |
scale | integer | Column’s xSQL data type scale |
is_flex | boolean | Denotes if column is a custom field on Incent sales order or participant objects |
odbc_data_type | short | Column’s xSQL data type mapping to ODBC data types. Type ID used. Used by Xactly’s ODBC driver. Refer to SHOW TYPES |
odbc_type_name | string | Column’s xSQL data type mapping to ODBC data types. Type name used. Used by Xactly’s ODBC driver. Refer to SHOW TYPES |
odbc_sql_data_type | short | Column’s xSQL data type mapping to ODBC data types. Type ID used.Used by Xactly’s ODBC driver. Refer to SHOW TYPES |
odbc_sql_date_time_sub_type |
short | Used by Xactly’s ODBC driver |
odbc_column_size |
integer | Used by Xactly’s ODBC driver |
odbc_buffer_length |
integer | Used by Xactly’s ODBC driver |
odbc_radix |
short | Used by Xactly’s ODBC driver |
nullable |
short | For future use |
is_nullable |
string | For future use |
default_value |
string | For future use |
ordinal |
integer | Order of the column compared to other columns in the table definition. |
octet_length |
integer | For future use |
primary_ordinal |
integer | For future use |
foreign_key_table_name |
string | For future use |
foreign_key_colummn_name |
string | For future use |
Examples
show table staging.order_item;
select schema_name, table_name, column_name
from (show table staging.order_item);
Related Commands