class %SQL.Manager.Catalog
extends %RegisteredObject
SQL Manager Catalog Queries
This class is used internally by Caché. You should not make direct
use of it within your applications. There is no guarantee made about either
the behavior or future operation of this class.
classmethod CachedQueryInfoClose(qh As %Library.Binary)
as %Library.Status
classmethod CachedQueryInfoExecute(ByRef qh As %Library.Binary, %schema As %Library.String)
as %Library.Status
classmethod CachedQueryInfoFetch(ByRef qh As %Library.Binary, ByRef Row As %Library.List, ByRef AtEnd As %Library.Integer = 0)
as %Library.Status
classmethod CachedQueryTableClose(qh As %Library.Binary)
as %Library.Status
classmethod CachedQueryTableExecute(ByRef qh As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod CachedQueryTableFetch(ByRef qh As %Library.Binary, ByRef Row As %Library.List, ByRef AtEnd As %Library.Integer = 0)
as %Library.Status
classmethod ConstraintsClose(%q As %Library.Binary)
as %Library.Status
classmethod ConstraintsExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod ConstraintsFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod FieldCalcSelectivityClose(%q As %Library.Binary)
as %Library.Status
classmethod FieldCalcSelectivityExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod FieldCalcSelectivityFetch(ByRef %q As %Library.Binary, ByRef %row As %Library.List, %atend As %Library.Integer)
as %Library.Status
classmethod FieldCurrentSelectivityClose(%q As %Library.Binary)
as %Library.Status
classmethod FieldCurrentSelectivityExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod FieldCurrentSelectivityFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod FieldsClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod FieldsExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod FieldsFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod GetCachedQueryInfo(Routine As %Library.String, ByRef CreateTime As %Library.TimeStamp, ByRef Source As %Library.Boolean, ByRef QueryType As %Library.Integer, ByRef Cost As %Library.Numeric)
as %Library.String
Returns information about the cached query Routine.
Returns a string containing the query text for the cached query. Returns
the create times by reference.
Source indicates that there is source for the routine and QueryType indicates whether it is a ODBC query or a Dynamic query.
classmethod GetCalcTableExtentSize(%schema As %Library.String, %tablename As %Library.String)
as %Library.Integer
Calculate the actual EXTENTSIZE of a base table
Parameters:
- %schema: name of the table's schema (required)
- %tablename: name of the table (required)
classmethod GetCurrentTableExtentSize(%schema As %Library.String, %tablename As %Library.String)
as %Library.Integer
METHODS
Get the currently defined EXTENTSIZE of a base table
Parameters:
- %schema: name of the table's schema (required)
- %tablename: name of the table (required)
classmethod IndicesClose(%q As %Library.Binary)
as %Library.Status
classmethod IndicesExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod IndicesFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod MakePat(like As %Library.String, esc As %Library.String)
as %Library.String
classmethod NamespacesWithXdbcErrorsClose(%q As %Library.Binary)
as %Library.Status
classmethod NamespacesWithXdbcErrorsExecute(ByRef %q As %Library.Binary)
as %Library.Status
classmethod NamespacesWithXdbcErrorsFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod ProcedureInfoClose(%q As %Library.Binary)
as %Library.Status
classmethod ProcedureInfoExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %proc As %Library.String)
as %Library.Status
classmethod ProcedureInfoFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod ProceduresClose(%q As %Library.Binary)
as %Library.Status
classmethod ProceduresExecute(ByRef %q As %Library.Binary, %schema As %Library.String, grantOnly As %Library.Boolean = 0)
as %Library.Status
classmethod ProceduresFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod PropertyInfo(class As %String = "", sort As %Integer = 1, ByRef info As %String)
as %Status
This method returns an array of properties and their column names subscripted by an integer.
The array can be ordered by property name or SQL column number.
classmethod RWListClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod RWListExecute(ByRef %q As %Library.Binary)
as %Library.Status
classmethod RWListFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod SQLCODEListClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod SQLCODEListExecute(ByRef %q As %Library.Binary)
as %Library.Status
classmethod SQLCODEListFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod SchemasClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod SchemasExecute(ByRef %q As %Library.Binary, system As %Library.Boolean = 0)
as %Library.Status
classmethod SchemasFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, ByRef AtEnd As %Library.Integer)
as %Library.Status
classmethod SchemasOnlyClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod SchemasOnlyExecute(ByRef %q As %Library.Binary, system As %Library.Boolean = 0, relType As %Library.String = "", grantOption As %Library.Boolean = 0)
as %Library.Status
classmethod SchemasOnlyFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, ByRef AtEnd As %Library.Integer)
as %Library.Status
classmethod SetFieldSelectivity(pSchema As %Library.String, pTableName As %Library.String, pFieldName As %Library.String, pSelectivity As %Library.String, pKeepClassUpToDate As %Boolean = 0)
as %Library.Status
Set the SELECTIVITY parameter of a field and property to the value of selectivity
Parameters:
- %schema: name of the table's schema (required)
- %tablename: name of the table (required)
- %fieldname: name of the field (required)
- selectivity: New selectivity value (property parameter format)
classmethod SetTableExtentSize(pSchema As %Library.String, pTablename As %Library.String, pExtentSize As %Library.Integer, pKeepClassUpToDate As %Boolean = 0)
as %Library.Status
Set the EXTENTSIZE parameter of a class and table to the value of extentsize
Parameters:
- %schema: name of the table's schema (required)
- %tablename: name of the table (required)
classmethod TablesClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod TablesExecute(ByRef %q As %Library.Binary, %schema As %Library.String)
as %Library.Status
classmethod TablesFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod TablesOnlyClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod TablesOnlyExecute(ByRef %q As %Library.Binary, %schema As %Library.String, grantOnly As %Library.Boolean = 1, pFilter As %Library.String = "")
as %Library.Status
classmethod TablesOnlyFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod TriggersClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod TriggersExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %table As %Library.String)
as %Library.Status
classmethod TriggersFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod ViewFieldsClose(%q As %Library.Binary)
as %Library.Status
classmethod ViewFieldsExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %view As %Library.String)
as %Library.Status
classmethod ViewFieldsFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod ViewInfo2Close(ByRef %q As %Library.Binary)
as %Library.Status
classmethod ViewInfo2Execute(ByRef %q As %Library.Binary, %schema As %Library.String, %view As %Library.String)
as %Library.Status
classmethod ViewInfo2Fetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod ViewInfoClose(%q As %Library.Binary)
as %Library.Status
classmethod ViewInfoExecute(ByRef %q As %Library.Binary, %schema As %Library.String, %view As %Library.String)
as %Library.Status
classmethod ViewInfoFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod ViewsOnlyClose(ByRef %q As %Library.Binary)
as %Library.Status
classmethod ViewsOnlyExecute(ByRef %q As %Library.Binary, %schema As %Library.String, grantOnly As %Library.Boolean = 0)
as %Library.Status
classmethod ViewsOnlyFetch(ByRef %q As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
classmethod XdbcErrorsClose(qh As %Library.Binary)
as %Library.Status
classmethod XdbcErrorsExecute(ByRef qh As %Library.Binary, nspace As %Library.String = "")
as %Library.Status
classmethod XdbcErrorsFetch(ByRef qh As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer)
as %Library.Status
query CachedQueryInfo(%schema As %Library.String)
Selects
Routine As %Library.String, Query As %Library.String, CreateTime As %Library.TimeStamp, Source As %Library.Boolean, QueryType As %Integer, QueryTypeExt As %Library.String, Cost As %Library.Numeric
QUERIES
The CachedQueryInfo query returns a list of cached queries
the current user has privilege to see in a given schema.
Note that only the first 80 characters of a query are returned.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.CachedQueryInfo Procedure
%SQL.Manager.Catalog.CachedQueryInfo(%schema)
Returns Cached Queries the current user is privileged to see in a given schema
ROWSPEC = ROUTINE:%Library.String - Name of the Cached Query's routine
QUERY:%Library.String - Cached Query's SQL Text
CREATE_TIME:%Library.TimeStamp - Date/Time of Cached Query creation
SOURCE:%Library.Boolean - Cached Query source there?
QUERYTYPE:%Integer - 6 or 7
QUERYTYPE_EXT:%String - ODBC QUERY OR DYNAMIC QUERY
COST:%Library.Numeric - QO Generated Cost of the query
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query CachedQueryTable(%schema As %Library.String, %table As %Library.String)
Selects
Routine As %Library.String, Query As %Library.String, CreateTime As %Library.TimeStamp, Source As %Library.Boolean, QueryType As %Integer, QueryTypeExt As %Library.String, Cost As %Library.Numeric
The CachedQueryInfo query returns a list of cached queries
for a given table/view.
Note that only the first 80 characters of a query are returned.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.CachedQueryTable Procedure
%SQL.Manager.Catalog.CachedQueryTable('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema.
and 1 %Library.String/VARCHAR type parameter which is the name of a table or view
Returns Cached Queries on this table the current user is privileged to see
ROWSPEC = ROUTINE:%Library.String - Name of the Cached Query's routine
QUERY:%Library.String - Cached Query's SQL Text
CREATE_TIME:%Library.TimeStamp - Date/Time of Cached Query creation
SOURCE:%Library.Boolean - Cached Query source there?
QUERYTYPE:%Integer - 6 or 7
QUERYTYPE_EXT:%String - ODBC QUERY OR DYNAMIC QUERY
COST:%Library.Numeric - QO Cost for ther query
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query Constraints(schema As %Library.String, table As %Library.String)
Selects
CONSTRAINT_NAME As %Library.String(MAXLEN=64), CONSTRAINT_TYPE As %Library.String(MAXLEN=15), CONSTRAINT_DATA As %Library.String(MAXLEN=255)
Get a List of all constraints from a schema.table.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.Constraints Procedure
%SQL.Manager.Catalog.Constraints('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema and
another %Library.String/VARCHAR type parameter which if the name of a table.
Returns all constraints in the table:
ROWSPEC = CONSTRAINT_NAME:%Library.String - Name of the constraint
TYPE:%Library.String - Type of constraint
CONSTRAINT_DATA:%Library.String - Constraint info depends on type
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query FieldCalcSelectivity(%schema As %Library.String, %table As %Library.String)
Selects
FIELD_NAME As %Library.String(MAXLEN=128), SELECTIVITY As %Library.String(MAXLEN=24)
Get a List of all Field's selectivity from a schema.table.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.FieldCalcSelectivity Procedure
%SQL.Manager.Catalog.FieldCalculatedSelectivity('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema an 1
%Library.String/VARCHAR type parameter which is the name of a table.
Returns all fields in the table:
ROWSPEC = FIELD_NAME:%Library.String - Name of the field
SELECTIVITY:%Library.String - Field's Calculated SELECTIVITY setting
Rows are returned in $$$UPPER(fieldname) order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query FieldCurrentSelectivity(%schema As %Library.String, %table As %Library.String)
Selects
FIELD_NAME As %Library.String(MAXLEN=128), SELECTIVITY As %Library.String(MAXLEN=24), NOTES As %Library.String(MAXLEN=50)
Get a List of all Field's selectivity from a schema.table.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.FieldCurrentSelectivity Procedure
%SQL.Manager.Catalog.FieldCurrentSelectivity('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema an 1
%Library.String/VARCHAR type parameter which is the name of a table.
Returns all fields in the table:
ROWSPEC = FIELD_NAME:%Library.String - Name of the field
SELECTIVITY:%Library.String - Field's SELECTIVITY setting
NOTES:%Library.String - Misc information about the field
Rows are returned in field name order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query Fields(%schema As %Library.String, %table As %Library.String)
Selects
FIELD_NAME As %Library.String, DATATYPE As %Library.String, COLUMN_NUMBER As %Library.Integer, REQUIRED As %Library.String, UNIQUE As %Library.String, COLLATION_FUNCTION As %Library.String, HIDDEN As %Library.String, MAXLEN As %Library.String, BLOB As %Library.String, CONTAINER_FIELD As %Library.String, SELECTIVITY As %Library.String, XDBC_TYPENAME As %Library.String, REFERENCE_TO As %Library.String, VERSION_COLUMN As %Library.String
Get a List of all Fields from a schema.table.
%SQL_MANAGER.Fields Procedure
%SQL.Manager.Catalog.Fields('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema an 1
%Library.String/VARCHAR type parameter which is the name of a table.
Returns all fields in the table:
ROWSPEC = FIELD_NAME:%Library.String - Name of the field
DATATYPE:%Library.String - Field's datatype
COLUMN_NUMBER:%Library.Integer - Field's internal column number
REQUIRED:%Library.String - Is field required, 'Yes' or 'No'
UNIQUE:%Library.String - Is field unique, 'Yes', or 'No'
COLLATION_FUNCTION:%Library.String - ALPHAUP, UPPER, STRING, EXACT, PLUS or MINUS
HIDDEN:%Library.String - Is field hidden, 'Yes' or 'No'
MAXLEN:%Library.String - MAXLEN parameter of field (or NULL)
BLOB:%Library.String - Is field a BLOB, 'Yes' or 'No'
CONTAINER_FIELD:%Library.String - If this is a sub-field of a serial container, the name of the serial field
SELECTIVITY:%Library.String - Field's SELECTIVITY
XDBC_TYPENAME:%Library.String - xDBC TYPENAME for this column
REFERENCE_TO:%Library.String - If a reference field, name of the table referenced
VERSION_COLUMN:%Library.String - Is this fild a Version Column, 'Yes' or 'No'
Rows are returned in column number order
query Indices(%schema As %Library.String, %table As %Library.String)
Selects
INDEX_NAME As %Library.String, SQL_MAP_NAME As %Library.String, FIELDS As %Library.String, TYPE As %Library.String, BI_ARGUMENT As %String
%SQL_MANAGER.Indices Procedure
%SQL.Manager.Catalog.Indices('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema and
another %Library.String/VARCHAR parameter which is the name of the table.
Returns all Indices in the table:
ROWSPEC = INDEX_NAME:%Library.String - Name of the index
SQL_MAP_NAME:%Library.String - Name of the SQL Map
FIELDS:%Library.String - Indexed Fields
TYPE:%Library.String - Type of Index. Unique, Bitmap, Bitmap Extent
BI_ARGUMENT:%Library.String - Name of index (if application, or SQL Map) What is passed to RebuildIndex
Rows are returned in no particular order
query NamespacesWithXdbcErrors()
Selects
NAMESPACE As %Library.String
Gets a list of namespaces which have an xDBC error defined.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.NamespacesWithXdbcErrors Procedure
%SQL.Manager.Catalog.NamespacesWithXdbcErrors()
Returns all Caché Namespaces which have one or more xDBC errors logged
ROWSPEC = NAMESPACE:%Library.String - Name of a NAMESPACE with at least 1 xDBC error logged
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query ProcedureInfo(%schema As %Library.String, %proc As %Library.String)
Selects
CLASS_NAME As %Library.String, PROCEDURE_TYPE As %Library.String, METHOD_OR_QUERY_NAME As %Library.String, DESCRIPTION As %Library.String, NUMBER_INPUT_PARAMS As %Library.Integer, NUMBER_INPUT_OUTPUT_PARAMS As %Library.Integer, NUMBER_OUTPUT_PARAMS As %Library.Integer, RETURN_VALUE As %Library.Integer, PROCEDURE_INTERFACE As %Library.String, NUMBER_OF_COLUMNS As %Library.Integer, INPUT_PARAMETERS As %Library.String, INPUT_OUTPUT_PARAMETERS As %Library.String, OUTPUT_PARAMETERS As %Library.String, RESULTSET_COLUMNS As %Library.String, RETURN_VALUE As %Library.String
Gets a detailed information about a single Stored Procedure
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.ProcedureInfo Procedure
%SQL.Manager.Catalog.ProcedureInfo('schema','proc_name')
Takes 1 %Library.String/VARCHAR type parameter which is an schema name and another
%Library.String/VARCHAR type parameter which is the name of a procedure within the schema.
Returns information for the Procedure
ROWSPEC = CLASS_NAME:%Library.String - Name of the class procedure method or query reside in
PROCEDURE_TYPE:%Library.String - Type of Stored procedure
METHOD_OR_QUERY_NAME:%Library.String - Name of the method or query the procedure is generated from
DESCRIPTION:%Library.String - Procedure's description
NUMBER_INPUT_PARAMS:%Library.Integer - Number of input paramaters
NUMBER_INPUT_OUTPUT_PARAMS:%Library.Integer - Number of input/output paramaters
NUMBER_OUTPUT_PARAMS:%Library.Integer - Number of output parameters
NUMBER_OUTPUT_PARAMS:%Library.Integer - Number of output parameters
RETURN_VALUE:%Library.Integer - Has a return value?
PROCEDURE_INTERFACE:%Library.String - -2, -1, 0, 1, or 2
-2 Procedure with a return value that may return result sets
-1 Procedure without a return value that may return result sets
0 Procedure without a return value, no result sets
1 query procedure (single static result set)
2 function with a return value, no result sets
INPUT_PARAMETERS:%Library.String - List of input parameters
INPUT_OUTPUT_PARAMETERS:%Library.String - List of input/output parameters
OUTPUT_PARAMETERS:%Library.String - List of output parameters
RESULTSET_COLUMNS:%Library.String - List of resultset columns
NUMBER_OF_COLUMNS:%Library.Integer - Number of columns
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query Procedures(%schema As %Library.String)
Selects
PROCEDURE_NAME As %Library.String, PROCEDURE_TYPE As %Library.String, PROCEDURE_CLASS As %Library.String, METHOD_OR_QUERY_NAME As %Library.String, ALLOW_DELETE As %Library.Boolean
Gets a description of the stored procedures available in the schema.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.Procedures Procedure
%SQL.Manager.Catalog.Procedures('schema','grantOnly')
Takes 1 %Library.String/VARCHAR type parameter which is a schema name
Returns all SQL Procedures which exist in the schema that the user is privileged to EXECUTE
If grantOnly is TRUE, only return procedures in the schema the user has at least one grantable privilege for
ROWSPEC = PROCEDURE_NAME:%Library.String - Name of the Stored procedure, LIKE Pattern allowed
PROCEDURE_TYPE:%Library.String - Type of Stored procedure
PROCEDURE_CLASS:%String - Name of the class which projected the Procedure
METHOD_OR_QUERY_NAME:%Library.String - Name of the method or query the procedure is generated from
ALLOW_DELETE:%Library.Boolean - 1/0 1 if we allow this procedure to be deleted (procedure's origin is this class)
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query RWList()
Selects
RESERVED_WORD As %Library.String
Returns a list of all SQL Reserved Words
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.RWList Procedure
%SQL.Manager.Catalog.SQLCODEList()
Returns list of all SQL Reserved Words
ROWSPEC = RESERVED_WORD:%Library.String - Reserved Word
Rows are returned in Reserved Word alphabetic order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query SQLCODEList()
Selects
SQLCODE As %Library.SmallInt, DESCRIPTION As %Library.String
Returns a list of all SQLCODE values and descriptions
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.SQLCODEList Procedure
%SQL.Manager.Catalog.SQLCODEList()
Returns list of all SQLCODE values and descriptions
ROWSPEC = SQLCODE:%Library.SmallInt - SQLCODE number
DESCRIPTION:%Library.String - SQLCODE Description
Rows are returned in SQLCODE order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query Schemas(system As %Library.Boolean = 0)
Selects
SCHEMA_NAME As %Library.String, TABLE_EXISTS As %Library.Boolean, VIEW_EXISTS As %Library.Boolean, PROCEDURE_EXISTS As %Library.Boolean, CACHED_QUERY_EXISTS As %Library.Boolean
Get a List of all Schemas in the current namespace.
%SQL_MANAGER.Schemas Procedure
%SQL.Manager.Catalog.Schemas()
Privileges are checked against pre-define $Username.
Returns a list of schemas defined in the current namespace.
ROWSEPC =
SCHEMA_NAME:%Library.String - Name of the schema
TABLE_EXISTS:%Library.Boolean - (1/0) Do any tables exist in this schema?
VIEW_EXISTS:%Library.Boolean - (1/0) Do any views exist in this schema?
PROCEDURE_EXISTS:%Library.Boolean - (1/0) Do any Stored Procedures exist in this schema?
CACHED_QUERY_EXISTS:%Library.Boolean - (1/0) Do any Cached Queries exist in this schema?
Rows are returned in order by SCHEMA_NAME
query SchemasOnly(system As %Library.Boolean = 0, relType As %Library.String = "", grantOption As %Library.Boolean = 0)
Selects
SCHEMA_NAME As %Library.String
Get a List of all Schemas in the current namespace, possibly filtered by privilege checking.
%SQL_MANAGER.SchemasOnly Procedure
%SQL.Manager.Catalog.SchemasOnly(system,relType,grantOption)
Privileges are checked against pre-define $Username.
Returns a list of schemas defined in the current namespace.
ROWSEPC =
SCHEMA_NAME:%Library.String - Name of the schema
Rows are returned in order by SCHEMA_NAME
query Tables(%schema As %Library.String)
Selects
NAME As %Library.String, TYPE As %Library.String, OWNER As %Library.String, LAST_COMPILED As %Library.TimeStamp, EXTERNAL As %Library.Boolean, READ_ONLY As %Library.Boolean, CLASSNAME As %Library.String, CHECK_OPTION As %Library.String(MAXLEN=8)
Get a List of all Basetables and Views in a schema.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.Tables Procedure
%SQL.Manager.Catalog.Tables('schema')
Privileges are checked against pre-define $Username.
Returns a list of tables and views defined in the current namespace.
ROWSPEC = NAME:%Library.String - Name of the table or view
TYPE:%Library.String - 'TABLE' or 'VIEW'
OWNER:%Library.String - SQL Username of the table's owner
LAST_COMPILED:%Library.TimeStamp - When the table's class was last compiled.
EXTERNAL:%Library.Boolean - TRUE if external table, FALSE if not
READ_ONLY:%Library.Boolean - TRUE is table is readonly, FALSE if not
CLASSNAME:%Library.String - Name of the class which projected the table/view
CHECK_OPTION:%Library.String - Pertains to views only. CASCADED, LOCAL, ""
Rows are returned in order by NAME
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query TablesOnly(%schema As %Library.String, grantOnly As %Library.Boolean = 1, pFilter As %Library.String = "")
Selects
NAME As %Library.String(MAXLEN=128), OWNER As %Library.String(MAXLEN=64), LAST_COMPILED As %Library.TimeStamp, EXTERNAL As %Library.Boolean, READ_ONLY As %Library.Boolean, CLASSNAME As %Library.String, ALLOW_DROP As %Library.Boolean
Get a List of all BaseTables in a schema.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.TablesOnly Procedure
%SQL.Manager.Catalog.TablesOnly('schema','grantOnly')
Privileges are checked against pre-define $Username.
Returns a list of tables defined in the current namespace for the given schema.
If grantOnly is TRUE, only return tables in the schema the user has at least one grantable privilege for
pFilter is an option name filter list. Examples are A*, A_B, 'C*
* means 0 or more characters
_ means any one character
' at the beginning means NOT pattern
ROWSPEC = NAME:%Library.String - Name of the table
OWNER:%Library.String - SQL Username of the table's owner
LAST_COMPILED:%Library.TimeStamp - When the table's class was last compiled.
EXTERNAL:%Library.Boolean - TRUE if external table, FALSE if not
READ_ONLY:%Library.Boolean - TRUE is table is readonly, FALSE if not
CLASSNAME:%Library.String - Name of the class which projected the table
ALLOW_DROP:%Library.Boolean = If TRUE, diplay the 'Delete' link to allow dropping the table
Rows are returned in order by NAME
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query Triggers(%schema As %Library.String, %table As %Library.String)
Selects
TRIGGER_NAME As %Library.String, TIME_EVENT As %Library.String, ORDER As %Library.Integer, CODE As %Library.String
Get a List of all Triggers from a schema.table.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.Triggers Procedure
%SQL.Manager.Catalog.Triggers('schema','tablename')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema and
another %Library.String/VARCHAR type parameter which is the name of a BaseTable.
Returns all triggers in the table:
ROWSPEC = TRIGGER_NAME:%Library.String - Name of the trigger
TIME_EVENT:%Library.String - Trigger's TIME and EVENT
ORDER:%Library.SmallInt - Trigger's order with the TIME_EVENT
CODE:%Library.String - Trigger code
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query ViewFields(%schema As %Library.String, %view As %Library.String)
Selects
FIELD_NAME As %Library.String, DATATYPE As %Library.String, MAXLEN As %Library.String, BLOB As %Library.String, LENGTH As %Library.Integer, PRECISION As %Library.Integer, SCALE As %Library.Integer
Get a List of all Fields from a schema.view.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.ViewFields Procedure
%SQL.Manager.Catalog.ViewFields('schema','viewname')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema and another
%Library.String/VARCHAR parameter which is the name of a view in the schema.
Returns all fields in the view:
ROWSPEC = FIELD_NAME:%Library.String - Name of the field
DATATYPE:%Library.String - Field's datatype
MAXLEN:%Library.String - MAXLEN parameter of field (or NULL)
BLOB:%Library.String - Is field a BLOB, 'Yes' or 'No'
LENGTH:%Library.Integer - Length of the column
PRECISION:%Library.Integer - Precision of the column
SCALE:%Library.Integer - Scale of the column
Rows are returned view column order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query ViewInfo(%schema As %Library.String, %view As %Library.String)
Selects
VIEW_QUERY As %Library.String
Get full View definition.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.ViewInfo Procedure
%SQL.Manager.Catalog.ViewInfo('schema','viewname')
Takes 1 %Library.String/VARCHAR type parameter which is the name of a schema
and another %Library.String/VARCHAR parameter which us the name of a View.
Returns a View's Query text
ROWSPEC = VIEW_QUERY:%Library.String - Query Text of the View
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query ViewInfo2(%schema As %Library.String, %view As %Library.String)
Selects
OWNER As %Library.String(MAXLEN=64), LAST_COMPILED As %Library.TimeStamp, DEFINED_AS_READ_ONLY As %Library.Boolean, UPDATABLE As %Library.Boolean, CLASSNAME As %Library.String(MAXLEN=64), CHECK_OPTION As %Library.String(MAXLEN=8), CLASSTYPE As %Library.String(MAXLEN=20)
Get info for a single View
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.ViewInfo2 Procedure
%SQL.Manager.Catalog.ViewInfo2('schema','viewname')
Returns metatdata information for the given view
ROWSPEC = OWNER:%Library.String - SQL Username of the view's owner
LAST_COMPILED:%Library.TimeStamp - When the view's class was last compiled.
DEFINED_AS_READ_ONLY:%Library.Boolean - TRUE is view is defined WITH READ ONLY (or with READONLY class parameter), FALSE if not
UPDATABLE:%Library.Boolean - TRUE is view is Updatable, FALSE if not
CLASSNAME:%Library.String - Name of the class which projected the view
CHECK_OPTION:%Library.String - CASCADED, LOCAL, ""
CLASSTYPE:%Library.String - Type of the class which projected the view, VIEW, PERSISTENT, etc.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query ViewsOnly(%schema As %Library.String, grantOnly As %Library.Boolean = 0)
Selects
NAME As %Library.String(MAXLEN=128), OWNER As %Library.String(MAXLEN=64), LAST_COMPILED As %Library.TimeStamp, READ_ONLY As %Library.Boolean, UPDATABLE As %Library.Boolean, CLASSNAME As %Library.String(MAXLEN=64), CHECK_OPTION As %Library.String(MAXLEN=8), CLASSTYPE As %Library.String(MAXLEN=20)
Get a List of all Views in a schema.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.ViewsOnly Procedure
%SQL.Manager.Catalog.ViewsOnly('schema')
Privileges are checked against pre-define $Username.
Returns a list of views defined in the current namespace within the given schema
If grantOnly is TRUE, only return views in the schema the user has at least one grantable privilege for
ROWSPEC = NAME:%Library.String - Name of the view
OWNER:%Library.String - SQL Username of the view's owner
LAST_COMPILED:%Library.TimeStamp - When the view's class was last compiled.
READ_ONLY:%Library.Boolean - TRUE is view is defined as readonly, FALSE if not
UPDATABLE:%Library.Boolean - TRUE is view is updatable, FALSE if not
CLASSNAME:%Library.String - Name of the class which projected the view
CHECK_OPTION:%Library.String - CASCADED, LOCAL, ""
CLASSTYPE:%Library.String - Type of the class which projected the view, VIEW, PERSISTENT, etc.
Rows are returned in order by NAME
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
query XdbcErrors(nspace As %Library.String = "%SYS")
Selects
DATE_TIME As %Library.String, PROCESS_ID As %Library.String, SQLCODE As %Library.String, CACHE_ERROR As %Library.String, LOCATION As %Library.String, MESSAGE As %Library.String, DisplayPID As %String
Gets all the xDBC errors logged in a single namespace.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%SQL_MANAGER.XdbcErrors Procedure
%SQL.Manager.Catalog.XdbcErrors('namespace')
Returns all xDBC errors logged in a given namespace
ROWSPEC = DATE_TIME:%Library.Timestamp - Date/Time the error was logged
PROCESS_ID:%Library.String - PID which got the error
SQLCODE:%Library.String - Code/String with the error
CACHE_ERROR:%Library.String - Caché error string
LOCATION:%Library.String - Where in the server the error occurred
DisplayID:%String - PID for displaying, hexadecimal for VMS.
Rows are returned in no particular order
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-