Skip to Content
-3

current_utcdate in SQL query

Dec 13, 2017 at 02:01 PM

51

avatar image

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

10 |10000 characters needed characters left characters exceeded

Why did you tag that as ABAP Development?

0

I used the similiar Query in ABAP program but later i was trying to test in SQL Console.I try to change the ABAP Development Tag .

0

Removed original primary tag "ABAP Testing and Analysis", because that does not really fit to the question.

@Umar: Please add a screenshot to show the error message including the SQL statement. Please also describe what you did, e.g. did you set the correct scheme ...

Regards,
Florian

0

I was trying to use current_utcdate in sql query but did not find solution.Screen shots are attached.

scc1.png (218.6 kB)
scc2.png (263.4 kB)
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Florian Pfeffer
Dec 28, 2017 at 11:58 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded