Schema:

ORGANIZATION_USAGE

TYPES view

Important

This view is only available in the organization account. For more information, see Premium views in the organization account.

This Organization Usage view displays a row for each user-defined type defined in an account.

See also:

TYPES view (Information Schema) , TYPES view (Account Usage)

Columns

Organization-level columns

Column NameData TypeDescription
ORGANIZATION_NAMEVARCHARName of the organization.
ACCOUNT_LOCATORVARCHARSystem-generated identifier for the account.
ACCOUNT_NAMEVARCHARUser-defined identifier for the account.

Additional columns

Column nameData typeDescription
TYPE_IDNUMBERInternal/system-generated identifier for the type.
TYPE_NAMEVARCHARName of the type.
TYPE_SCHEMA_IDNUMBER

Internal/system-generated identifier for the schema that contains the type.

TYPE_SCHEMAVARCHARSchema that contains the type.
TYPE_CATALOG_IDNUMBER

Internal/system-generated identifier for the database that contains the type.

TYPE_CATALOGVARCHARDatabase that contains the type.
TYPE_OWNERVARCHARName of the role that owns the type.
OWNER_ROLE_TYPEVARCHAR

The type of role that owns the object, for example ROLE.
If a Snowflake Native App owns the object, the value is APPLICATION.
Snowflake returns NULL if you delete the object because a deleted object does not have an owner role.

BASE_DATA_TYPEVARCHARUnderlying data type of the user-defined type.
CHARACTER_MAXIMUM_LENGTHNUMBERMaximum length in characters for VARCHAR types.
CHARACTER_OCTET_LENGTHNUMBERMaximum length in bytes for VARCHAR types.
NUMERIC_PRECISIONNUMBERNumeric precision for NUMBER types.
NUMERIC_PRECISION_RADIXNUMBERRadix of the numeric precision for NUMBER types.
NUMERIC_SCALENUMBERNumeric scale for NUMBER types.
DATETIME_PRECISIONNUMBERFractional seconds precision for TIMESTAMP types.
CHECK_EXPRESSIONVARCHARNot applicable for Snowflake.
DEFAULT_EXPRESSIONVARCHARNot applicable for Snowflake.
IS_NULLABLE_DEFAULTVARCHARNot applicable for Snowflake.
COLLATION_NAMEVARCHARNot applicable for Snowflake.
CREATEDTIMESTAMP_LTZDate and time when the type was created.
LAST_ALTEREDTIMESTAMP_LTZ

Date and time the object was last altered by a DML, DDL, or background metadata operation. See Usage Notes_.

DELETEDTIMESTAMP_LTZDate and time when the type was dropped.
COMMENTVARCHARComment for this type.

Usage notes

  • Latency for the view might be up to 24 hours.
  • The view only displays objects for which the current role for the session has been granted access privileges.
  • The view doesn’t recognize the MANAGE GRANTS privilege and consequently might show less information compared to a SHOW command executed by a user who holds the MANAGE GRANTS privilege.
  • The LAST_ALTERED column is updated when the following operations are performed on an object:

    • DDL operations.
    • DML operations (for tables only). This column is updated even when no rows are affected by the DML statement.
    • Background maintenance operations on metadata performed by Snowflake.

Examples

Retrieve all user-defined types in the organization:

SELECT type_name, type_catalog, type_schema, type_owner, base_data_type
  FROM SNOWFLAKE.ORGANIZATION_USAGE.TYPES
  ORDER BY created DESC;

Retrieve user-defined types that have been dropped:

SELECT type_name, type_catalog, type_schema, deleted
  FROM SNOWFLAKE.ORGANIZATION_USAGE.TYPES
  WHERE deleted IS NOT NULL
  ORDER BY deleted DESC;