on 2014 Oct 27 5:29 PM
Hi,
When I try this command from SQL console, I get a resolution till milliseconds (see attached screen).
Do you know if it is possible to increase the resolution till microseconds?
According to the documentation I should be able to get a detail of 7 decimal digits, but after the first three digits all others are 0.
Thanks
Francesco
SELECT TO_VARCHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DD HH24:MI:SS.FF7') "to timestamp" FROM DUMMY
Request clarification before answering.
Hi Francesco,
> According to the documentation I should be able to get a detail of 7 decimal digits, but after the first three digits all others are 0.
Where did you find this info? I don't think CURRENT_TIMESTAMP or NOW() will return the resolution till microseconds. You cannot find this info from CURRENT_TIMESTAMP - SAP HANA SQL and System Views Reference - SAP Library or NOW - SAP HANA SQL and System Views Reference - SAP Library.
However it's true in SAP HANA that the format of TIMESTAMP is "YYYY-MM-DD HH24:MI:SS.FF7" You can find it from Data Types - SAP HANA SQL and System Views Reference - SAP Library
The format of TIMESTAMP and the result of CURRENT_TIMESTAMP are two different things.
CREATE COLUMN TABLE TT (T TIMESTAMP);
INSERT INTO TT VALUES (TO_TIMESTAMP('2014-10-28 14:00:00.1234567', 'YYYY-MM-DD HH24:MI:SS.FF7'));
INSERT INTO TT VALUES (CURRENT_TIMESTAMP);
SELECT TO_VARCHAR(T, 'YYYY-MM-DD HH24:MI:SS.FF7') "to timestamp" FROM TT;
Best regards,
Wenjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Wenjun,
Thanks.
Maybe I have not been clear in my question: my point is as HANA timestamp supports timestamp resolution till 7 digits, is there any way to get such resolution in an HANA procedure?
As you said CURRENT_TIMESTAMP and NOW seem not to do it.
In my opinion documentation here is not very detailed, I would expect something more, also because if I try to handle the result of CURRENT_TIMESTAMP with a precision less than FF7 I get an error, so why should I consider CURRENT_TIMESTAMP with precision of 7 if the last 4 digits are blank?
Francesco
the question is still open.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.