%Library.ODBCCatalog
hidden class %Library.ODBCCatalog
ODBC Catalog QueriesMethod Inventory
- MakePat()
- brClose()
- brExecute()
- brFetch()
- c3Close()
- c3Execute()
- c3Fetch()
- caClose()
- caExecute()
- caFetch()
- coClose()
- coExecute()
- coFetch()
- cpClose()
- cpExecute()
- cpFetch()
- crClose()
- crExecute()
- crFetch()
- e3Close()
- e3Execute()
- e3Fetch()
- ekClose()
- ekExecute()
- ekFetch()
- i3Close()
- i3Execute()
- i3Fetch()
- ikClose()
- ikExecute()
- ikFetch()
- p3Close()
- p3Execute()
- p3Fetch()
- pcClose()
- pcExecute()
- pcFetch()
- pkClose()
- pkExecute()
- pkFetch()
- prClose()
- prExecute()
- prFetch()
- r3Close()
- r3Execute()
- r3Fetch()
- scClose()
- scExecute()
- scFetch()
- stClose()
- stExecute()
- stFetch()
- t3Close()
- t3Execute()
- t3Fetch()
- taClose()
- taExecute()
- taFetch()
- tiClose()
- tiExecute()
- tiFetch()
- tpClose()
- tpExecute()
- tpFetch()
- ttExecute()
- ttFetch()
- vcExecute()
- vcFetch()
Methods
classmethod c3Execute(ByRef qh As %Binary, table As %String, column As %String, schema As %String) as %Status
classmethod coExecute(ByRef qh As %Binary, table As %String, column As %String, schema As %String) as %Status
classmethod cpExecute(ByRef qh As %Binary, table As %String, column As %String, schema As %String) as %Status
classmethod crExecute(ByRef qh As %Binary, primary As %String, foreign As %String, pkschema As %String, fkschema As %String) as %Status
classmethod p3Execute(ByRef qh As %Binary, procedure As %String, column As %String, schema As %String) as %Status
classmethod pcExecute(ByRef qh As %Binary, procedure As %String, column As %String, schema As %String) as %Status
classmethod r3Execute(ByRef qh As %Binary, primary As %String, foreign As %String, pkschema As %String, fkschema As %String) as %Status
classmethod stExecute(ByRef qh As %Binary, table As %String, schema As %String, nonunique As %SmallInt) as %Status
Queries
Selects SCOPE As %SmallInt, COLUMN_NAME As %String(MAXLEN=128), DATA_TYPE As %SmallInt, TYPE_NAME As %String(MAXLEN=128), COLUMN_SIZE As %Integer, BUFFER_LENGTH As %Integer, DECIMAL_DIGITS As %SmallInt, PSEUDO_COLUMN As %SmallInt
Get a description of a table's optimal set of columns that uniquely identifies a row.
******************************************************************************
%ODBCCatalog_br Stored Procedure for SQLSpecialColumns (SQL_BEST_ROWID=1)
******************************************************************************
query c3(table As %String(MAXLEN=128), column As %String(MAXLEN=128), schema As %String(MAXLEN=128))
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), COLUMN_NAME As %String(MAXLEN=128), DATA_TYPE As %SmallInt, TYPE_NAME As %String(MAXLEN=128), COLUMN_SIZE As %Integer, BUFFER_LENGTH As %Integer, DECIMAL_DIGITS As %SmallInt, NUM_PREC_RADIX As %SmallInt, NULLABLE As %SmallInt, REMARKS As %String(MAXLEN=128), COLUMN_DEF As %String(MAXLEN=4096), SQL_DATA_TYPE As %SmallInt, SQL_DATETIME_SUB As %SmallInt, CHAR_OCTET_LENGTH As %Integer, ORDINAL_POSITION As %Integer, IS_NULLABLE As %String(MAXLEN=3)
Get columns info from the catalog, sorted by schema, table name, and ordinal position
***************************************************************************
%ODBCCatalog_c3 Stored Procedure for SQLColumns (ODBC 3.5)
***************************************************************************
query ca()
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), TABLE_TYPE As %String(MAXLEN=128), REMARKS As %String(MAXLEN=254)
Gets the catalog names available in the database.
***************************************************************************
%ODBCCatalog_ca Stored Procedure for SQLTables with only '%' specified
for TABLE_QUALIFIER, NULL specified for TABLE_TYPE and
TABLE_NAME, TABLE_OWNER.
***************************************************************************
query co(table As %String(MAXLEN=128), column As %String(MAXLEN=128), schema As %String(MAXLEN=128))
Selects TABLE_QUALIFIER As %String(MAXLEN=128), TABLE_OWNER As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), COLUMN_NAME As %String(MAXLEN=128), DATA_TYPE As %SmallInt, TYPE_NAME As %String(MAXLEN=128), PRECISION As %Integer, LENGTH As %Integer, SCALE As %SmallInt, RADIX As %SmallInt, NULLABLE As %SmallInt, REMARKS As %String(MAXLEN=128), COLUMN_DEF As %String(MAXLEN=4096)
Get columns info from the catalog, sorted by schema, table name, and ordinal position
***************************************************************************
%ODBCCatalog_co Stored Procedure for SQLColumns for ODBC 2.5 and under
***************************************************************************
query cp(table As %String(MAXLEN=128), column As %String(MAXLEN=128), schema As %String(MAXLEN=128))
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), COLUMN_NAME As %String(MAXLEN=128), GRANTOR As %String(MAXLEN=128), GRANTEE As %String(MAXLEN=128), PRIVILEGE As %String(MAXLEN=128), IS_GRANTABLE As %String(MAXLEN=3)
Gets column privileges, sorted by column name and privilege
***************************************************************************
%ODBCCatalog_cp Stored Procedure for SQLColumnPrivileges
***************************************************************************
query cr(primary As %String(MAXLEN=128), foreign As %String(MAXLEN=128), pkschema As %String(MAXLEN=128), fkschema As %String(MAXLEN=128))
Selects PKTABLE_QUALIFIER As %String(MAXLEN=128), PKTABLE_OWNER As %String(MAXLEN=128), PKTABLE_NAME As %String(MAXLEN=128), PKCOLUMN_NAME As %String(MAXLEN=128), FKTABLE_QUALIFIER As %String(MAXLEN=128), FKTABLE_OWNER As %String(MAXLEN=128), FKTABLE_NAME As %String(MAXLEN=128), FKCOLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, UPDATE_RULE As %SmallInt, DELETE_RULE As %SmallInt, FK_NAME As %String(MAXLEN=128), PK_NAME As %String(MAXLEN=128)
Describes how one table imports the keys of another table.
***************************************************************************
%ODBCCatalog_cr Stored Procedure for SQLForeignKeys (Cross Reference) ODBC 2.5
For when values are specified for PkTableOwner/PkTableName
and FkTableOwner/FkTableName
***************************************************************************
Selects PKTABLE_CAT As %String(MAXLEN=128), PKTABLE_SCHEM As %String(MAXLEN=128), PKTABLE_NAME As %String(MAXLEN=128), PKCOLUMN_NAME As %String(MAXLEN=128), FKTABLE_CAT As %String(MAXLEN=128), FKTABLE_SCHEM As %String(MAXLEN=128), FKTABLE_NAME As %String(MAXLEN=128), FKCOLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, UPDATE_RULE As %SmallInt, DELETE_RULE As %SmallInt, FK_NAME As %String(MAXLEN=128), PK_NAME As %String(MAXLEN=128), DEFERRABILITY As %SmallInt
Gets a description of the foreign key columns that reference the primary key columns in table TABLE.
***************************************************************************
%ODBCCatalog_e3 Stored Procedure for SQLForeignKeys (Exported Keys) ODBC 3.5
For when values are specified for PkTableOwner/PkTableName only
***************************************************************************
Selects PKTABLE_QUALIFIER As %String(MAXLEN=128), PKTABLE_OWNER As %String(MAXLEN=128), PKTABLE_NAME As %String(MAXLEN=128), PKCOLUMN_NAME As %String(MAXLEN=128), FKTABLE_QUALIFIER As %String(MAXLEN=128), FKTABLE_OWNER As %String(MAXLEN=128), FKTABLE_NAME As %String(MAXLEN=128), FKCOLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, UPDATE_RULE As %SmallInt, DELETE_RULE As %SmallInt, FK_NAME As %String(MAXLEN=128), PK_NAME As %String(MAXLEN=128)
Gets a description of the foreign key columns that reference the primary key columns in table TABLE.
***************************************************************************
%ODBCCatalog_ek Stored Procedure for SQLForeignKeys (Exported Keys) ODBC 2.5
For when values are specified for PkTableOwner/PkTableName only
***************************************************************************
Selects PKTABLE_CAT As %String(MAXLEN=128), PKTABLE_SCHEM As %String(MAXLEN=128), PKTABLE_NAME As %String(MAXLEN=128), PKCOLUMN_NAME As %String(MAXLEN=128), FKTABLE_CAT As %String(MAXLEN=128), FKTABLE_SCHEM As %String(MAXLEN=128), FKTABLE_NAME As %String(MAXLEN=128), FKCOLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, UPDATE_RULE As %SmallInt, DELETE_RULE As %SmallInt, FK_NAME As %String(MAXLEN=128), PK_NAME As %String(MAXLEN=128), DEFERRABILITY As %SmallInt
Gets a description of the primary key columns that are referenced by the foreign key columns in table TABLE.
***************************************************************************
%ODBCCatalog_i3 Stored Procedure for SQLForeignKeys (Imported Keys) ODBC 3.5
For when values are specified for FkTableOwner/FkTableName only
***************************************************************************
Selects PKTABLE_QUALIFIER As %String(MAXLEN=128), PKTABLE_OWNER As %String(MAXLEN=128), PKTABLE_NAME As %String(MAXLEN=128), PKCOLUMN_NAME As %String(MAXLEN=128), FKTABLE_QUALIFIER As %String(MAXLEN=128), FKTABLE_OWNER As %String(MAXLEN=128), FKTABLE_NAME As %String(MAXLEN=128), FKCOLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, UPDATE_RULE As %SmallInt, DELETE_RULE As %SmallInt, FK_NAME As %String(MAXLEN=128), PK_NAME As %String(MAXLEN=128)
Gets a description of the primary key columns that are referenced by the foreign key columns in table TABLE.
***************************************************************************
%ODBCCatalog_ik Stored Procedure for SQLForeignKeys (Imported Keys) ODBC 2.5
For when values are specified for FkTableOwner/FkTableName only
***************************************************************************
query p3(procedure As %String(MAXLEN=128), column As %String(MAXLEN=128), schema As %String(MAXLEN=128))
Selects PROCEDURE_CAT As %String(MAXLEN=128), PROCEDURE_SCHEM As %String(MAXLEN=128), PROCEDURE_NAME As %String(MAXLEN=128), COLUMN_NAME As %String(MAXLEN=128), COLUMN_TYPE As %SmallInt, DATA_TYPE As %SmallInt, TYPE_NAME As %String(MAXLEN=128), COLUMN_SIZE As %Integer, BUFFER_LENGTH As %Integer, DECIMAL_DIGITS As %SmallInt, NUM_PREC_RADIX As %SmallInt, NULLABLE As %SmallInt, REMARKS As %String(MAXLEN=254), COLUMN_DEF As %String(MAXLEN=4096), SQL_DATA_TYPE As %SmallInt, SQL_DATETIME_SUB As %SmallInt, CHAR_OCTET_LENGTH As %Integer, ORDINAL_POSITION As %Integer, IS_NULLABLE As %String(MAXLEN=3)
Gets a description of the input, output and results associated with certain stored procedures available in the catalog.
***************************************************************************
%ODBCCatalog_p3 Stored Procedure for SQLProcColumns ODBC 3.5
***************************************************************************
query pc(procedure As %String(MAXLEN=128), column As %String(MAXLEN=128), schema As %String(MAXLEN=128))
Selects PROCEDURE_QUALIFIER As %String(MAXLEN=128), PROCEDURE_OWNER As %String(MAXLEN=128), PROCEDURE_NAME As %String(MAXLEN=128), COLUMN_NAME As %String(MAXLEN=128), COLUMN_TYPE As %SmallInt, DATA_TYPE As %SmallInt, TYPE_NAME As %String(MAXLEN=128), PRECISION As %Integer, LENGTH As %Integer, SCALE As %SmallInt, RADIX As %SmallInt, NULLABLE As %SmallInt, REMARKS As %String(MAXLEN=254)
Gets a description of the input, output and results associated with certain stored procedures available in the catalog.
***************************************************************************
%ODBCCatalog_pc Stored Procedure for SQLProcColumns ODBC 2.5
***************************************************************************
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), COLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, PK_NAME As %String(MAXLEN=128)
Gets a description of a table's primary key columns.
***************************************************************************
%ODBCCatalog_pk Stored Procedure for SQLPrimaryKeys
***************************************************************************
Selects PROCEDURE_CAT As %String(MAXLEN=128), PROCEDURE_SCHEM As %String(MAXLEN=128), PROCEDURE_NAME As %String(MAXLEN=128), NUM_INPUT_PARAMS As %SmallInt, NUM_OUTPUT_PARAMS As %SmallInt, NUM_RESULT_SETS As %SmallInt, REMARKS As %String(MAXLEN=254), PROCEDURE_TYPE As %SmallInt
Gets a description of the stored procedures available in the catalog.
***************************************************************************
%ODBCCatalog_pr Stored Procedure for SQLProcedures
***************************************************************************
query r3(primary As %String(MAXLEN=128), foreign As %String(MAXLEN=128), pkschema As %String(MAXLEN=128), fkschema As %String(MAXLEN=128))
Selects PKTABLE_CAT As %String(MAXLEN=128), PKTABLE_SCHEM As %String(MAXLEN=128), PKTABLE_NAME As %String(MAXLEN=128), PKCOLUMN_NAME As %String(MAXLEN=128), FKTABLE_CAT As %String(MAXLEN=128), FKTABLE_SCHEM As %String(MAXLEN=128), FKTABLE_NAME As %String(MAXLEN=128), FKCOLUMN_NAME As %String(MAXLEN=128), KEY_SEQ As %SmallInt, UPDATE_RULE As %SmallInt, DELETE_RULE As %SmallInt, FK_NAME As %String(MAXLEN=128), PK_NAME As %String(MAXLEN=128), DEFERRABILITY As %SmallInt
Describes how one table imports the keys of another table.
***************************************************************************
%ODBCCatalog_r3 Stored Procedure for SQLForeignKeys (Cross Reference) ODBC 3.5
For when values are specified for PkTableOwner/PkTableName
and FkTableOwner/FkTableName
***************************************************************************
query sc()
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), TABLE_TYPE As %String(MAXLEN=128), REMARKS As %String(MAXLEN=254)
Gets the schema names available in the database.
***************************************************************************
%ODBCCatalog_sc Stored Procedure for SQLTables with only '%' specified
for TABLE_OWNER, NULL specified for QUALIFIER and
TABLE_NAME.
***************************************************************************
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), NON_UNIQUE As %SmallInt, INDEX_QUALIFIER As %String(MAXLEN=128), INDEX_NAME As %String(MAXLEN=128), TYPE As %SmallInt, ORDINAL_POSITION As %SmallInt, COLUMN_NAME As %String(MAXLEN=128), ASC_OR_DESC As %String(MAXLEN=1), CARDINALITY As %Integer, PAGES As %Integer, FILTER_CONDITION As %String(MAXLEN=128)
Get a description of table's indices and statistics
***************************************************************************
%ODBCCatalog_st Stored Procedure for SQLStatistics
***************************************************************************
query t3(name As %String(MAXLEN=128))
Selects TYPE_NAME As %String(MAXLEN=128), DATA_TYPE As %SmallInt, COLUMN_SIZE As %Integer, LITERAL_PREFIX As %String(MAXLEN=128), LITERAL_SUFFIX As %String(MAXLEN=128), CREATE_PARAMS As %String(MAXLEN=128), NULLABLE As %SmallInt, CASE_SENSITIVE As %SmallInt, SEARCHABLE As %SmallInt, UNSIGNED_ATTRIBUTE As %SmallInt, FIXED_PREC_SCALE As %SmallInt, AUTO_UNIQUE_VALUE As %SmallInt, LOCAL_TYPE_NAME As %String(MAXLEN=128), MINIMUM_SCALE As %SmallInt, MAXIMUM_SCALE As %SmallInt, SQL_DATA_TYPE As %SmallInt, SQL_DATETIME_SUB As %SmallInt, NUM_PREC_RADIX As %Integer, INTERVAL_PRECISION As %SmallInt
Gets a description of all the datatypes supported by the database.
***************************************************************************
%ODBCCatalog_t3 Stored Procedure for SQLGetTypeInfo ODBC 3.5
***************************************************************************
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), TABLE_TYPE As %String(MAXLEN=128), REMARKS As %String(MAXLEN=254)
Gets a description of the tables available in the catalog.
***************************************************************************
%ODBCCatalog_ta Stored Procedure for SQLTables
***************************************************************************
query ti(name As %String(MAXLEN=128))
Selects TYPE_NAME As %String(MAXLEN=128), DATA_TYPE As %SmallInt, PRECISION As %Integer, LITERAL_PREFIX As %String(MAXLEN=128), LITERAL_SUFFIX As %String(MAXLEN=128), CREATE_PARAMS As %String(MAXLEN=128), NULLABLE As %SmallInt, CASE_SENSITIVE As %SmallInt, SEARCHABLE As %SmallInt, UNSIGNED_ATTRIBUTE As %SmallInt, MONEY As %SmallInt, AUTO_INCREMENT As %SmallInt, LOCAL_TYPE_NAME As %String(MAXLEN=128), MINIMUM_SCALE As %SmallInt, MAXIMUM_SCALE As %SmallInt
Gets a description of all the datatypes supported by the database.
***************************************************************************
%ODBCCatalog_ti Stored Procedure for SQLGetTypeInfo ODBC 2.5
***************************************************************************
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), GRANTOR As %String(MAXLEN=128), GRANTEE As %String(MAXLEN=128), PRIVILEGE As %String(MAXLEN=128), IS_GRANTABLE As %String(MAXLEN=3)
Gets a description of the access rights for each table available in the catalog.
***************************************************************************
%ODBCCatalog_tp Stored Procedure for SQLTablePrivileges
***************************************************************************
query tt()
Selects TABLE_CAT As %String(MAXLEN=128), TABLE_SCHEM As %String(MAXLEN=128), TABLE_NAME As %String(MAXLEN=128), TABLE_TYPE As %String(MAXLEN=128), REMARKS As %String(MAXLEN=254)
Gets the table types available in this database.
***************************************************************************
%ODBCCatalog_tt Stored Procedure for SQLTables with only '%' specified
for TABLE_TYPE, NULL specified for QUALIFIER and
TABLE_NAME, TABLE_OWNER.
***************************************************************************
query vc()
Selects SCOPE As %SmallInt, COLUMN_NAME As %String(MAXLEN=128), DATA_TYPE As %SmallInt, TYPE_NAME As %String(MAXLEN=128), COLUMN_SIZE As %Integer, BUFFER_LENGTH As %Integer, DECIMAL_DIGITS As %SmallInt, PSEUDO_COLUMN As %SmallInt
Gets a description of the columns in a table that are automatically updated when any value in a row is updated.
***************************************************************************
%ODBCCatalog_vc Stored Procedure
***************************************************************************