JBoss.orgCommunity Documentation
The built-in SYS and SYSADMIN schemas provide metadata tables and procedures against the current VDB.
This table provides the current VDB contents.
Column Name |
Type |
Description |
---|---|---|
resourcePath |
string |
The path to the contents. |
contents |
blob |
The contents as a blob. |
This table supplies information about the currently connected virtual database, of which there is always exactly one (in the context of a connection).
Column Name |
Type |
Description |
---|---|---|
Name |
string |
The name of the VDB |
Version |
string |
The version of the VDB |
This table supplies information about all the schemas in the virtual database, including the system schema itself (System).
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
Name |
string |
Schema name |
IsPhysical |
boolean |
True if this represents a source |
UID |
string |
Unique ID |
OID |
integer |
Unique ID (see note below) |
Description |
string |
Description |
PrimaryMetamodelURI |
string |
URI for the primary metamodel describing the model used for this schema |
This table supplies user-defined properties on all objects based on metamodel extensions. Normally, this table is empty if no metamodel extensions are being used.
Column Name |
Type |
Description |
---|---|---|
Name |
string |
Extension property name |
Value |
string |
Extension property value |
UID |
string |
Key unique ID |
OID |
integer |
Unique ID (see note below) |
This table supplies information about all the groups (tables, views, documents, etc) in the virtual database.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
Name |
string |
Short group name |
Type |
string |
Table type (Table, View, Document, ...) |
NameInSource |
string |
Name of this group in the source |
IsPhysical |
boolean |
True if this is a source table |
SupportsUpdates |
boolean |
True if group can be updated |
UID |
string |
Group unique ID |
OID |
integer |
Unique ID (see note below) |
Cardinality |
integer |
Approximate number of rows in the group |
Description |
string |
Description |
IsSystem |
boolean |
True if in system table |
This table supplies information about all the materailized views in the virtual database.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
Name |
string |
Short group name |
TargetSchemaName |
string |
Name of the materialized table schema |
TargetName |
string |
Name of the materialized table |
Valid |
boolean |
True if materialized table is currently valid. |
LoadState |
boolean |
The load state, can be one of NEEDS_LOADING, LOADING, LOADED, FAILED_LOAD |
Updated |
timestamp |
The timestamp of the last full refresh. |
Cardinality |
integer |
The number of rows in the materialized view table. |
This table supplies information about all the elements (columns, tags, attributes, etc) in the virtual database.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
TableName |
string |
Table name |
Name |
string |
Element name (not qualified) |
Position |
integer |
Position in group (1-based) |
NameInSource |
string |
Name of element in source |
DataType |
string |
Teiid runtime data type name |
Scale |
integer |
Number of digits after the decimal point |
ElementLength |
integer |
Element length (mostly used for strings) |
sLengthFixed |
boolean |
Whether the length is fixed or variable |
SupportsSelect |
boolean |
Element can be used in SELECT |
SupportsUpdates |
boolean |
Values can be inserted or updated in the element |
IsCaseSensitive |
boolean |
Element is case-sensitive |
IsSigned |
boolean |
Element is signed numeric value |
IsCurrency |
boolean |
Element represents monetary value |
IsAutoIncremented |
boolean |
Element is auto-incremented in the source |
NullType |
string |
Nullability: "Nullable", "No Nulls", "Unknown" |
MinRange |
string |
Minimum value |
MaxRange |
string |
Maximum value |
DistinctCount |
integer |
Distinct value count, -1 can indicate unknown |
NullCount |
integer |
Null value count, -1 can indicate unknown |
SearchType |
string |
Searchability: "Searchable", "All Except Like", "Like Only", "Unsearchable" |
Format |
string |
Format of string value |
DefaultValue |
string |
Default value |
JavaClass |
string |
Java class that will be returned |
Precision |
integer |
Number of digits in numeric value |
CharOctetLength |
integer |
Measure of return value size |
Radix |
integer |
Radix for numeric values |
GroupUpperName |
string |
Upper-case full group name |
UpperName |
string |
Upper-case element name |
UID |
string |
Element unique ID |
OID |
integer |
Unique ID (see note below) |
Description |
string |
Description |
This table supplies information about primary, foreign, and unique keys.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
Table Name |
string |
Table name |
Name |
string |
Key name |
Description |
string |
Description |
NameInSource |
string |
Name of key in source system |
Type |
string |
Type of key: "Primary", "Foreign", "Unique", etc |
IsIndexed |
boolean |
True if key is indexed |
RefKeyUID |
string |
Referenced key UID (if foreign key) |
UID |
string |
Key unique ID |
OID |
integer |
Unique ID (see note below) |
This table supplies information about the columns referenced by a key.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
TableName |
string |
Table name |
Name |
string |
Element name |
KeyName |
string |
Key name |
KeyType |
string |
Key type: "Primary", "Foreign", "Unique", etc |
RefKeyUID |
string |
Referenced key UID |
UID |
string |
Key UID |
OID |
integer |
Unique ID (see note below) |
Position |
integer |
Position in key |
This table supplies information about the procedures in the virtual database.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
Name |
string |
Procedure name |
NameInSource |
string |
Procedure name in source system |
ReturnsResults |
boolean |
Returns a result set |
UID |
string |
Procedure UID |
OID |
integer |
Unique ID (see note below) |
Description |
string |
Description |
This supplies information on procedure parameters.
Column Name |
Type |
Description |
---|---|---|
VDBName |
string |
VDB name |
SchemaName |
string |
Schema Name |
ProcedureName |
string |
Procedure name |
Name |
string |
Parameter name |
DataType |
string |
Teiid runtime data type name |
Position |
integer |
Position in procedure args |
Type |
string |
Parameter direction: "In", "Out", "InOut", "ResultSet", "ReturnValue" |
Optional |
boolean |
Parameter is optional |
Precision |
integer |
Precision of parameter |
TypeLength |
integer |
Length of parameter value |
Scale |
integer |
Scale of parameter |
Radix |
integer |
Radix of parameter |
NullType |
string |
Nullability: "Nullable", "No Nulls", "Unknown" |
This table supplies information on datatypes.
Column Name |
Type |
Description |
---|---|---|
Name |
string |
Teiid design-time type name |
IsStandard |
boolean |
Always false |
IsPhysical |
boolean |
Always false |
TypeName |
string |
Design-time type name (same as Name) |
JavaClass |
string |
Java class returned for this type |
Scale |
integer |
Max scale of this type |
TypeLength |
integer |
Max length of this type |
NullType |
string |
Nullability: "Nullable", "No Nulls", "Unknown" |
IsSigned |
boolean |
Is signed numeric? |
IsAutoIncremented |
boolean |
Is auto-incremented? |
IsCaseSensitive |
boolean |
Is case-sensitive? |
Precision |
integer |
Max precision of this type |
Radix |
integer |
Radix of this type |
SearchType |
string |
Searchability: "Searchable", "All Except Like", "Like Only", "Unsearchable" |
UID |
string |
Data type unique ID |
OID |
integer |
Unique ID (see note below) |
RuntimeType |
string |
Teiid runtime data type name |
BaseType |
string |
Base type |
Description |
string |
Description of type |
The OID column is guranteed to be unique/consistent only for given version running instance of a VDB. If a different version of the VDB is deployed, these IDs are not guranteed to be the same or unique across both versions of the VDB. Dynamic VDB OIDs are not cluster safe.
Returns a resultset with a single column, schema, containing the schemas as clobs.
SYS.getXMLSchemas(document in string) returns schema string
Log a message to the underlying logging system.
SYSADMIN.logMsg(logged RETURN boolean, level IN string, context IN string, msg IN object)
Returns true if the message was logged. level can be one of the log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. level defaults to 'DEBUG' and context defaults to 'org.teiid.PROCESSOR'
Example 11.1. Example logMsg
CALL SYSADMIN.logMsg(msg=>'some debug', context=>'org.something')
This will log the message 'some debug' at the default level DEBUG to the context org.something.
Tests if logging is enabled at the given level and context.
SYSADMIN.isLoggable(loggable RETURN boolean, level IN string, context IN string)
Returns true if logging is enabled. level can be one of the log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. level defaults to 'DEBUG' and context defaults to 'org.teiid.PROCESSOR'
Example 11.2. Example isLoggable
IF ((CALL SYSADMIN.isLoggable(context=>'org.something')) BEGIN DECLARE STRING msg; // logic to build the message ... CALL SYSADMIN.logMsg(msg=>msg, context=>'org.something') END
Returns integer RowsUpdated. -1 indicates a load is in progress, otherwise the cardinality of the table is returned. See the Caching Guide for more.
SYSADMIN.refreshMatView(RowsUpdated return integer, ViewName in string, Invalidate in boolean)
Returns integer RowsUpdated. -1 indicates the materialized table is currently invalid. 0 indicates that the specified row did not exist in the live data query or in the materialized table. See the Caching Guide for more.
SYSADMIN.refreshMatViewRow(RowsUpdated return integer, ViewName in string, Key in object)
A MetadataRepository
must be configured to make a non-temporary metadata update persistent. See the Developers Guide Runtime Metadata Updates section for more.
Set statistics for the given table.
SYSADMIN.setTableStats(TableName in string, Cardinality in integer)
Set statistics for the given column.
SYSADMIN.setColumnStats(TableName in string, ColumnName in string, DistinctCount in integer, NullCount in integer, Max in string, Min in string)
All stat values are nullable. Passing a null stat value will leave corresponding metadata value unchanged.
Set an extension metadata property for the given record. Extension metadata is typically used by Chapter 13, Translators.
SYSADMIN.setProperty(OldValue return clob, Uid in string, Name in string, Value in clob)
Setting a value to null will remove the property.
Example 11.3. Example Property Set
CALL SYSADMIN.setProperty(uid=>(SELECT uid FROM TABLES WHERE name='tab'), name=>'some name', value=>'some value')
This will set the property 'some name'='some value' on table tab.
The use of this procedure will not trigger replanning of associated prepared plans.