Skip to Content
G B

invalid default datetime value error while activating odata service

Hello Community

I have my table definition inside a CDS file (.hdbdd)

ENTITY ORDER
    {
    KEY ORDER_ID: Integer;
        CREATION_DATE: UTCDateTime default CURRENT_UTCTIMESTAMP;
    };

I need my date to give details such as YYYY-MM-DD HH:MM:SS.

1) Is the default value (CURRENT_UTCTIMESTAMP) provided appropriate for the same? I couldn't find any documentation in developer guide for CDS regarding the default values that can be chosen for DATE data type. Please let me know where to find the same.

2) When I try to create a service definition for this table in xsodata, it throws me an error during activation-

Invalid default datetime value for property "CREATION_DATE" in "ORDER": CURRENT_UTCTIMESTAMP

I get this error whenever I set a default value. I also tried changing it to a different data type, but still the same error persists whenever I set a default value.

CREATION_DATE: LocalDate default CURRENT_DATE

I need this default value to work while data gets inserted from UI. Please provide any ideas.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 15, 2017 at 06:46 AM

    Hi Community

    Based on an internal discussion with Thomas Jung, seems like the defualt values in CDS work with XSODATA in XSA/HDI only. But my system is not yet upgraded to XSA/HDI. He suggested me to raise a support ticket for the same.

    Add comment
    10|10000 characters needed characters exceeded