X$Field
The X$Field system table is associated with the file FIELD.DDF. X$Field contains information about all the columns and named indexes defined in the database. The structure of X$Field is as follows:
Table C-4 X$Field System Table Structure
Column Name |
Type |
Size |
Case Insensitive |
Description |
Xe$Id |
USMALLINT |
2 |
N/A |
Internal ID Pervasive.SQL assigns, unique for each field in the database. |
Xe$File |
USMALLINT |
2 |
N/A |
ID of table to which this column or named index belongs. It corresponds to Xf$Id in X$File. |
Xe$Name |
CHAR |
20 |
Yes |
Column name or index name. |
Xe$DataType |
UTINYINT |
1 |
N/A |
Control field - Column data type (range 0-26). If value is 227, it represents a constraint name. If value is 255, it represents an index name. |
Xe$Offset |
USMALLINT |
2 |
N/A |
Column offset in table; index number if named index. Offsets are zero-relative. Index Number corresponds to the value stored in the Xi$Number column in the X$Index system table. Segment Number corresponds to the value stored in the Xi$Part column in the X$Index system table. |
Xe$Size |
USMALLINT |
2 |
N/A |
Column size, representing the internal storage, in bytes, required for the field. |
Xe$Dec |
UTINYINT |
1 |
N/A |
Column decimal place (for DECIMAL, NUMERIC, NUMERICSA, NUMERICSTS, MONEY, or CURRENCY types). Relative bit positions for contiguous bit columns. Fractional seconds for TIMESTAMP data type. |
Xe$Flags |
USMALLINT |
2 |
N/A |
Flags word. Bit 0 is the case flag for string data types. If bit 0 = 1, the field is case insensitive. If bit 2 = 1, the field allows null values. Bit 3 of Xe$flag is used to differentiate a Pervasive.SQL v7 1-byte TINYINT (B_TYPE_INTEGER unsigned) from SRDE's 1-byte TINYINT (B_TYPE_INTEGER, but signed). If bit 3 = 1 and Xe$datatype = 1 and Xe$size =1, then it means that TINYINT column is created by the SRDE and is a signed 1-byte TINYINT. If bit 3 = 0 and Xe$datatype = 1 and xe$size = 1 then it means that TINYINT column is created by the legacy SQL engine and is an unsigned 1-byte TINYINT. If bit 12 = 1, the field is interpreted as binary. |
The column Xe$File corresponds to the column Xf$Id in the X$File system table and is the link between the tables and the columns they contain. So, for example, the following query shows you all of the field definitions in order for the Billing table.
SELECT "X$Field".*
FROM X$File,X$Field
WHERE Xf$Id=Xe$File AND Xf$Name = 'Billing'
ORDER BY Xe$Offset
The integer values in column Xe$DataType are codes that represent the Pervasive.SQL data types. See Pervasive.SQL Supported Data Types for the codes.
Five indexes are defined for the X$Field table, as follows:
Table C-5 X$Field System Table Index Definitions
Index Number |
Segment Number |
Column Name |
Duplicates |
Case Insensitive |
Segmented |
0 |
0 |
Xe$Id |
No |
N/A |
No |
1 |
0 |
Xe$File |
Yes |
N/A |
No |
2 |
0 |
Xe$Name |
Yes |
Yes |
No |
3 |
0 |
Xe$File |
No |
N/A |
Yes |
3 |
1 |
Xe$Name |
No |
Yes |
No |
4 |
0 |
Xe$File |
Yes |
N/A |
Yes |
4 |
1 |
Xe$Offset |
Yes |
N/A |
Yes |
4 |
2 |
Xe$Dec |
Yes |
N/A |
No |