Summary
The DESCRIBE
command returns metadata for the specified table. The command can also display metadata for any result set generated by an xSQL or xCL expression. The metadata in both use cases includes the table’s schema, columns, and column data types, among others.
Syntax
DESCRIBE SELECT * FROM <schema_name.table_name>; DESCRIBE SELECT * FROM (<expression>); |
Parameters
Parameter
|
Description
|
---|---|
select * from <schema_name>.<table_name> |
The SELECT statement determines which schema, table, and columns will be included in the command’s output. |
select * from (<expression>) |
The expression can be any xSQL or xCL expression that returns a result set. Refer to example below. |
Details
DESCRIBE returns metadata for any columns listed in the SELECT
statements.
The following table lists the columns returned in DESCRIBE
‘s result set.
Column Name
|
Data Type
|
Description
|
---|---|---|
index |
integer |
Ordinal number of a column within the table. |
name |
string |
Column name |
fullName |
string |
Verbose column name for internal use by Connect application |
label |
string |
For future use |
type |
integer |
Column’s xSQL data type id. |
typeName |
string |
Column’s xSQL data type name. |
subType |
integer |
For future use |
subTypeName |
string |
For future use |
size |
integer |
xSQL data type’s max size |
scale |
integer |
xSQL data type’s max scale. Not used for all data types. |
Examples
describe select * from xactly.xc_payment;
describe select period_name, amount, amount_display_symbol from xactly.xc_payment;
/* Example using an expression instead of a table. */
describe select * from (eval LookupPeriodName('2015-04-01', 'monthly'));
;
/* Example shows how to SELECT certain columns from the DESCRIBE
result set */
select name, typeName, size, scale from (describe select * from xactly.xc_payment);