7.5 Mapping Oracle Data Types to PGX Types

Learn how the input Oracle AI Database types are mapped to its corresponding PGX types, when a graph from the database is loaded into the graph server (PGX).

The following table applies for both SQL property graphs and PGQL property graphs.

Table 7-1 Mapping Oracle Data Types to PGX Types

Oracle AI DatabaseFoot 1 PGX Type
NUMBER The following implicit type conversion rules apply:
  • NUMBER => LONG (for key columns)
  • NUMBER => DOUBLE (for non-key columns)
  • NUMBER(m) (number having precision m) with m <= 9 => INTEGER
  • NUMBER(m) (number having precision m) with 9 < m <= 18 => LONG
  • NUMBER(m,n) (number having precision m and scale n) => DOUBLE

    Note that this applies if n > 0. Otherwise, it follows the same mapping as NUMBER(x), where x = m-n (that is, subtracting the scale from the precision). The PGX type can then vary, depending on the x value as shown:

    • x <= 9 => INTEGER
    • 9 < x <= 18 => LONG
    • x > 18 => DOUBLE

      For instance, consider a scenario where n = -100 and m = 1. In this case, x = 101 (m-n), which is greater than 18. Extremely large numbers cannot be encoded to fit in INTEGER or LONG and therefore require the DOUBLE data type.

CHAR or NCHAR STRING
VARCHAR, VARCHAR2, or NVARCHAR2 STRING
BINARY_FLOAT FLOAT
BINARY_DOUBLE DOUBLE
FLOAT The following implicit type conversion rules apply:
  • FLOAT(m) with m <= 23 => FLOAT
  • FLOAT(m) with 23 < m => DOUBLE

In the preceding entries, m is the variable for precision.

CLOB STRING
DATE or TIMESTAMP TIMESTAMP
TIMESTAMP WITH LOCAL TIME ZONE TIMESTAMP
TIMESTAMP WITH TIME ZONE TIMESTAMP WITH TIME ZONE

Footnote 1 Data types for PGQL property graphs and SQL Property Graphs share a one-to-one mapping with Oracle data types.