The eXtremeSQL Metatable

The eXtremeSQL Metatable is a system maintained table that contains information about all database objects (tables, fields, indexes) defined for a given database.

It can be accessed through the SQL select statement. For example the following command displays the data for a simple table Account with three fields userid, name and lastlog:

 
    XSQL>select * from Metatable;
    TableName       FieldNo FieldName       FieldTypeName   FieldType       FieldSize       AutoGenerated   ReferencedTable
    Nullable        Precision       Width   ElementType     ElementTypeName
    ------------------------------------------------------------------------------
    Account 1       userid  Int4    6       0       false   null    false   -1      -1      0       Null
    Account 2       name    String  15      0       false   null    true    -1      -1      0       Null
    Account 3       lastlog DateTime        12      0       false   null    true    -1      -1      0       Null
 
    Selected records: 3
     

 

Metatable Data Types Names

The following table shows the correlation between SQL Data Types and their names in the Metatable. For more detailed information use the link for the data type of interest.

SQL type eXtremeSQL Metatable name
BINARY(dim) tpBinary
VARBINARY tpBinary
BLOB Blob
BOOLEAN Bool
BIT Bool
TINYINT, INT[EGER](1) Int1
SMALLINT, INT[EGER](2) Int2
INT[EGER](4) Int4
BIGINT, LONGINT INT[EGER](8) Int8
UNSIGNED[(dim)] Uint1, Uint2, Uint4, Uint8
FLOAT Real4
REAL, DOUBLE Real8
DECIMAL[(w,p)] Numeric
NUMERIC[(w,p)] Numeric
CHAR(n) String
CHAR, VARCHAR, LONGVARCHAR, STRING String
UNICODE(n) Unicode
UNICODE Unicode
DATE DateTime
TIME DateTime
TIMESTAMP DateTime