Built-in Types

    The following built-in types are provided:

    CDS Type Arguments / Remarks Example Value SQL (5)
    UUID an opaque 36-characters string (1) 'be071623-8699-4106-b6fa-8e3cb04c261e' NVARCHAR(36)
    Boolean   true BOOLEAN
    Integer   1337 INTEGER
    Integer64   1337 BIGINT
    Decimal ( precision, scale ) (2) 15.2 DECIMAL
    Double   15.2 DOUBLE
    Date   '2021-06-27' DATE
    Time   '07:59:59' TIME
    DateTime sec precision '2021-06-27T14:52:23Z' TIMESTAMP
    Timestamp 0.1 µs precision (3) '2021-06-27T14:52:23.123Z' TIMESTAMP
    String ( length ) (4) 'hello world' NVARCHAR
    Binary ( length ) (4)   VARBINARY
    LargeBinary     BLOB
    LargeString   'hello world' NCLOB


    (1) At runtime, UUIDs are treated as opaque values and are, for example, not converted to lower case on input. UUIDs generated in the application are RFC 4122-compliant. See Don’t Interpret UUIDs! for details.

    (2) Arguments precision and scale are optional → if omitted a decfloat type is used

    (3) Up to 7 digits of fractional seconds; if a data is given with higher precision truncation may occur

    (4) Argument length is optional → if omitted a default length is used

    (5) Mapping to ANSI SQL types are given for comparison. Note though, that you need to have the specification of your target database in mind when considering, for example, length restrictions.

    See also…

    Mapping to OData EDM types

    HANA-native Data Types

    Show/Hide Beta Features