INFORMATION.SCHEMA.COLUMNS
Class INFORMATION.SCHEMA.COLUMNS Extends %Library.Persistent [ ClassType = persistent, Final, Owner = {_PUBLIC}, SqlRowIdPrivate, SqlTableName = COLUMNS, StorageStrategy = SQLStorage, System = 4 ]
Returns one row for each column that can be accessed by the current user in the current namespace.
Parameters
READONLY
Parameter READONLY = 1;
Properties
SchemaExact
Property SchemaExact As %String(MAXLEN = 128) [ Internal, Private, Required, SqlColumnNumber = 45 ];
TableExact
Property TableExact As %String(MAXLEN = 128) [ Internal, Private, Required, SqlColumnNumber = 46 ];
SystemTable
Property SystemTable As %Integer [ Calculated, Internal, Private, Required, SqlColumnNumber = 47, SqlComputeCode = { set {*}=$s($e({TABLE_SCHEMA})="%"||({TABLE_SCHEMA}="INFORMATION_SCHEMA"):1,1:0) }, SqlComputed ];
Is the table a system table (1 or 0)
TABLECATALOG
Property TABLECATALOG As %String(MAXLEN = 128) [ Calculated, SqlColumnNumber = 2, SqlComputeCode = { set {*}=""}, SqlComputed, SqlFieldName = TABLE_CATALOG ];
Table qualifier - always NULL in InterSystems IRIS
TABLESCHEMA
Property TABLESCHEMA As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 3, SqlFieldName = TABLE_SCHEMA ];
Name of schema that contains the table.
TABLENAME
Property TABLENAME As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 4, SqlFieldName = TABLE_NAME ];
Name of the table.
COLUMNNAME
Property COLUMNNAME As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 5, SqlFieldName = COLUMN_NAME ];
Name of the column.
ORDINALPOSITION
Property ORDINALPOSITION As %Integer [ Required, SqlColumnNumber = 6, SqlFieldName = ORDINAL_POSITION ];
Column's ordinal position within the table.
DTDIDENTIFIER
Property DTDIDENTIFIER As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 7, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = DTD_IDENTIFIER ];
Reserved for future use. For InterSystems IRIS DTD_IDENTIFIER is always NULL.
DOMAINCATALOG
Property DOMAINCATALOG As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 8, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = DOMAIN_CATALOG ];
Reserved for future use. For InterSystems IRIS DOMAIN_CATALOG is always NULL.
DOMAINSCHEMA
Property DOMAINSCHEMA As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 9, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = DOMAIN_SCHEMA ];
Reserved for future use. For InterSystems IRIS DOMAIN_SCHEMA is always NULL.
DOMAINNAME
Property DOMAINNAME As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 10, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = DOMAIN_NAME ];
Reserved for future use. For InterSystems IRIS DOMAIN_NAME is always NULL.
COLUMNDEFAULT
Property COLUMNDEFAULT As %String(MAXLEN = 4000) [ SqlColumnNumber = 11, SqlFieldName = COLUMN_DEFAULT ];
Default value for the column.
ISNULLABLE
Property ISNULLABLE As %String(MAXLEN = 3, VALUELIST = ",YES,NO") [ SqlColumnNumber = 12, SqlFieldName = IS_NULLABLE ];
If the column allows a NULL value, IS_NULLABLE returns YES, otherwise NO.
ISSELFREFERENCING
Property ISSELFREFERENCING As %String(MAXLEN = 3, VALUELIST = ",YES,NO") [ Calculated, SqlColumnNumber = 13, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IS_SELF_REFERENCING ];
Reserved for future use. For InterSystems IRIS IS_SELF_REFERENCING is always NULL.
ISIDENTITY
Property ISIDENTITY As %String(MAXLEN = 3, VALUELIST = ",YES,NO") [ SqlColumnNumber = 14, SqlFieldName = IS_IDENTITY ];
If this column is an IDENTITY column IS_IDENTITY returns YES, otherwise NO.
IDENTITYGENERATION
Property IDENTITYGENERATION As %String(MAXLEN = 10, VALUELIST = ",ALWAYS,BY DEFAULT") [ Calculated, SqlColumnNumber = 15, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IDENTITY_GENERATION ];
Reserved for future use. For InterSystems IRIS IDENTITY_GENERATION is always NULL.
IDENTITYSTART
Property IDENTITYSTART As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 16, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IDENTITY_START ];
Reserved for future use. For InterSystems IRIS IDENTITY_START is always NULL.
IDENTITYINCREMENT
Property IDENTITYINCREMENT As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 17, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IDENTITY_INCREMENT ];
Reserved for future use. For InterSystems IRIS IDENTITY_INCREMENT is always NULL.
IDENTITYMAXIMUM
Property IDENTITYMAXIMUM As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 18, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IDENTITY_MAXIMUM ];
Reserved for future use. For InterSystems IRIS IDENTITY_MAXIMUM is always NULL.
IDENTITYMINIMUM
Property IDENTITYMINIMUM As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 19, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IDENTITY_MINIMUM ];
Reserved for future use. For InterSystems IRIS IDENTITY_MINIMUM is always NULL.
IDENTITYCYCLE
Property IDENTITYCYCLE As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 20, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = IDENTITY_CYCLE ];
Reserved for future use. For InterSystems IRIS IDENTITY_CYCLE is always NULL.
ISGENERATED
Property ISGENERATED As %String(MAXLEN = 3) [ SqlColumnNumber = 21, SqlFieldName = IS_GENERATED ];
If the column is an SqlComputed column IS_GENERATED returns YES, otherwise NO.
GENERATIONEXPRESSION
Property GENERATIONEXPRESSION As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 22, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = GENERATION_EXPRESSION ];
Reserved for future use. For InterSystems IRIS GENERATION_EXPRESSION is always NULL.
ISUPDATABLE
Property ISUPDATABLE As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 23, SqlComputeCode = { new tType set tType=$lg(^oddSQL({SchemaExact},{TableExact}),4)
Returns YES if the column is updatable, otherwise NO.
All base tables are updatable and every column of a base table is updatable.
A view colum's updatability depends on the view's updatablity.
DATATYPE
Property DATATYPE As %String(MAXLEN = 128) [ SqlColumnNumber = 24, SqlFieldName = DATA_TYPE ];
Name of the ODBC type for this column.
odbctype
Property odbctype As %Integer [ Internal, SqlColumnNumber = 50 ];
Number of the ODBC type for this column.
CHARACTERMAXIMUMLENGTH
Property CHARACTERMAXIMUMLENGTH As %Integer [ Calculated, SqlColumnNumber = 25, SqlComputeCode = { if $case({odbctype},-4:1,-3:1,-1:1,12:1,:0) { set {*}=$lg(^oddSQL({SchemaExact},{TableExact},8,{ORDINAL_POSITION}),8) set:({*}=-1)||({*}=$c(2)) {*}=$$$ODBCVarcharMaxlen} else { set {*}="" }}, SqlComputed, SqlFieldName = CHARACTER_MAXIMUM_LENGTH ];
Column's maximum length, in characters, for binary or character data.
CHARACTEROCTETLENGTH
Property CHARACTEROCTETLENGTH As %Integer [ Calculated, SqlColumnNumber = 26, SqlComputeCode = { if $case({odbctype},-4:1,-3:1,-1:1,12:1,:0) { set {*}=$lg(^oddSQL({SchemaExact},{TableExact},8,{ORDINAL_POSITION}),8) set:({*}=-1)||({*}=$c(2)) {*}=$$$ODBCVarcharMaxlen} else { set {*}="" }}, SqlComputed, SqlFieldName = CHARACTER_OCTET_LENGTH ];
Column's maximum length, in bytes, for binary or character data. For InterSystems IRIS this is the same as CHARACTER_MAXIMUM_LENGTH.
NUMERICPRECISION
Property NUMERICPRECISION As %Library.TinyInt [ Calculated, SqlColumnNumber = 27, SqlComputeCode = { if $case({odbctype},-6:1,-5:1,2:1,4:1,5:1,8:1,:0) { set {*}=$lg(^oddSQL({SchemaExact},{TableExact},8,{ORDINAL_POSITION}),7) } else { set {*}="" }}, SqlComputed, SqlFieldName = NUMERIC_PRECISION ];
Column's precision for fields of datatype TINYINT, SMALLINT, INTEGER, BIGINT, NUMERIC, and DOUBLE. Otherwise, NULL is returned.
NUMERICPRECISIONRADIX
Property NUMERICPRECISIONRADIX As %Library.SmallInt [ Calculated, SqlColumnNumber = 28, SqlComputeCode = { if $case({odbctype},-6:1,-5:1,2:1,4:1,5:1,8:1,:0) { set {*}=$lg(^oddSQL({SchemaExact},{TableExact},8,{ORDINAL_POSITION}),10) } else { set {*}="" }}, SqlComputed, SqlFieldName = NUMERIC_PRECISION_RADIX ];
Column's precision radix for fields of datatype TINYINT, SMALLINT, INTEGER, BIGINT, NUMERIC, and DOUBLE. Otherwise, NULL is returned.
NUMERICSCALE
Property NUMERICSCALE As %Integer [ Calculated, SqlColumnNumber = 29, SqlComputeCode = { if $case({odbctype},-6:1,-5:1,2:1,4:1,5:1,8:1,:0) { set {*}=$lg(^oddSQL({SchemaExact},{TableExact},8,{ORDINAL_POSITION}),9) } else { set {*}="" }}, SqlComputed, SqlFieldName = NUMERIC_SCALE ];
Column's numeric scale for fields of datatype TINYINT, SMALLINT, INTEGER, BIGINT, NUMERIC, and DOUBLE. Otherwise, NULL is returned.
DATETIMEPRECISION
Property DATETIMEPRECISION As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 30, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = DATETIME_PRECISION ];
Reserved for future use. For InterSystems IRIS DATETIME_PRECISION is always NULL.
CHARACTERSETCATALOG
Property CHARACTERSETCATALOG As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 31, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = CHARACTER_SET_CATALOG ];
Reserved for future use. For InterSystems IRIS CHARACTER_SET_CATALOG is always NULL.
CHARACTERSETSCHEMA
Property CHARACTERSETSCHEMA As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 32, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = CHARACTER_SET_SCHEMA ];
Reserved for future use. For InterSystems IRIS CHARACTER_SET_SCHEMA is always NULL.
CHARACTERSETNAME
Property CHARACTERSETNAME As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 33, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = CHARACTER_SET_NAME ];
Reserved for future use. For InterSystems IRIS CHARACTER_SET_NAME is always NULL.
COLLATIONCATALOG
Property COLLATIONCATALOG As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 34, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = COLLATION_CATALOG ];
Reserved for future use. For InterSystems IRIS COLLATION_CATALOG is always NULL.
COLLATIONSCHEMA
Property COLLATIONSCHEMA As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 35, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = COLLATION_SCHEMA ];
Reserved for future use. For InterSystems IRIS COLLATION_SCHEMA is always NULL.
COLLATIONNAME
Property COLLATIONNAME As %String(MAXLEN = 3) [ Calculated, SqlColumnNumber = 36, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = COLLATION_NAME ];
Reserved for future use. For InterSystems IRIS COLLATION_NAME is always NULL.
DESCRIPTION
Property DESCRIPTION As %String(MAXLEN = 8192) [ Calculated, SqlColumnNumber = 37, SqlComputeCode = {
Description of the column from the class definition. Returns NULL if the column is not from a table.
AUTOINCREMENT
Property AUTOINCREMENT As %String(MAXLEN = 3, VALUELIST = ",YES,NO") [ SqlColumnNumber = 38, SqlFieldName = AUTO_INCREMENT ];
If this column increments automatically upon insert, AUTO_INCREMENT returns YES, otherwise NO.
UNIQUECOLUMN
Property UNIQUECOLUMN As %String(MAXLEN = 3, VALUELIST = ",YES,NO") [ SqlColumnNumber = 39, SqlFieldName = UNIQUE_COLUMN ];
If this column in the sole column in a unique constraint, UNIQUE_COLUMN returns YES, otherwise NO.
PRIMARYKEY
Property PRIMARYKEY As %String(MAXLEN = 3, VALUELIST = ",YES,NO") [ SqlColumnNumber = 40, SqlFieldName = PRIMARY_KEY ];
If this column appears in the primary key constraint for this table, PRIMARY_KEY returns YES, otherwise NO.
PROPERTYNAME
Property PROPERTYNAME As %String(MAXLEN = 128) [ Calculated, Private, SqlColumnNumber = 41, SqlComputeCode = { set {*} = $$$SQLLocColPropertyName($$$EXTSQLCOLsqlinfo($$$rEXT,$$$GetExtentNameFromTableName({TABLE_SCHEMA},{TABLE_NAME}),{COLUMN_NAME})) }, SqlComputed, SqlFieldName = PROPERTY_NAME ];
The class property name projected to this column
COMPUTECODE
Property COMPUTECODE As %String(MAXLEN = 3200) [ Calculated, Private, SqlColumnNumber = 42, SqlComputeCode = { new c set c = $$$GetClassNameFromTableName({TABLE_SCHEMA},{TABLE_NAME}), {*} = $$$defMemberKeyGet(c,$$$cCLASSproperty,{PROPERTY_NAME},$$$cPROPsqlcomputecode) }, SqlComputed, SqlFieldName = COMPUTE_CODE ];
The SqlComputeCode for this column
ISPERSISTED
Property ISPERSISTED As %String(MAXLEN = 3) [ Calculated, Private, SqlColumnNumber = 43, SqlComputeCode = { new c set c = $$$GetClassNameFromTableName({TABLE_SCHEMA},{TABLE_NAME}), {*} = $s($$$defMemberKeyGet(c,$$$cCLASSproperty,{PROPERTY_NAME},$$$cPROPtransient):"NO", $$$defMemberKeyGet(c,$$$cCLASSproperty,{PROPERTY_NAME},$$$cPROPcalculated):"NO", 1:"YES") }, SqlComputed, SqlFieldName = IS_PERSISTED ];
This field expresses whether the column's value is actually persisted, meaning nor calculated nor transient