Skip to Content
-3

current_utcdate in SQL query

I am using below query in SQL Console of SAP HANA Studio.

SELECT carrid,connid,fldate,current_utcdate as "Current Date" FROM sflight

I am facing below error

"FROM" is invalid here ( due to grammar). contains an invalid character or it is a

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 28, 2017 at 11:58 AM

    You are using the SQL Console of the ABAP Development Tools and not of the SAP HANA Tools. Therefore the SAP HANA SQL function CURRENT_UTCDATE cannot be used here, because only Open SQL is valid in that console.

    Depending on what you wanna do - use HANA functions or Open SQL functions - you have to either

    - switch to the HANA SQL console to apply HANA SQL statements

    - use the OpenSQL Date/Time function TSTMP_CURRENT_UTCTIMESTAMP which is available since NW 7.50 (-> https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abencds_f1_date_time_functions.htm).

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded