on 06-03-2015 9:23 PM
Hi team,
I was trying to collect the data from the view M_BACKUP_CATALOG.
20150315081801546000000 : SYS_START_TIME.
When i check the functions i dont see a function to convert this field into date and time.
hI,
are you looking for somethign like below ? that column is a timestamp type and below function can covert to date and time.
select TO_DATE(SYS_START_TIME ), TO_TIME(SYS_START_TIME ) from M_BACKUP_CATALOG
-Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it will work for sure as the datatype conversion is possible for timestamp to time and vice versa.
Data Types - SAP HANA SQL and System Views Reference - SAP Library
Could you please share the screenshot like definition , errors and your SQL ?
Siva
This is the error what i was getting.
xception CX_DBA_ADBC in class CL_HDB_SQL_EXECUTOR method EXEC_QUERY_DYN line 123
Kernel Error ID:
WP ID: 29
WP PID: 14489
Application Server: va2lpsap065
SYSID: UPA
SY-SUBRC: 0
SQL statement: select TO_DATE(SYS_START_TIME ), TO_TIME(SYS_START_TIME ) from M_BACKUP_CATALOG
Database: DEFAULT
caused by
Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
Kernel Error ID:
DB Error: Yes
SQL Code: 10412-
SQL Message: Illegal TIME value for parameter/column (2)
DB Object Exists: No
Duplicated Key: No
Internal Error: 1
Invalid Cursor: No
Unknown Connection: No
My HANA revision is 82.
View definition is below.
ROW TABLE "SYS"."M_BACKUP_CATALOG" ( "ENTRY_ID",
"ENTRY_TYPE_NAME",
"BACKUP_ID",
"SYS_START_TIME",
"UTC_START_TIME",
"SYS_END_TIME",
"UTC_END_TIME",
"STATE_NAME",
"COMMENT",
"MESSAGE" ) AS ( SELECT
CAST(T0.ENTRY_TYPE_NAME AS VARCHAR(64)) ENTRY_TYPE_NAME,
CAST(T0.COMMENT AS VARCHAR(256)) COMMENT,
CAST(T0.MESSAGE AS VARCHAR(512)) MESSAGE
FROM SYS.M_DEV_BACKUP_CATALOG_DATA_ T0
WHERE 1 = (SELECT
FROM SYS.HAS_NEEDED_SYSTEM_PRIV_INCL_SYS_STAT)
OR HASSYSTEMPRIVILEGE (CURRENT_USER,
'BACKUP ADMIN') = 1
OR HASSYSTEMPRIVILEGE (CURRENT_USER,
'BACKUP OPERATOR') = 1
UNION ALL SELECT
CAST('log backup' AS VARCHAR(64)) ENTRY_TYPE_NAME,
CAST('' AS VARCHAR(256)) COMMENT,
CAST(T0.MESSAGE AS VARCHAR(512)) MESSAGE
FROM SYS.M_DEV_BACKUP_CATALOG_LOG_ T0
WHERE 1 = (SELECT
FROM SYS.HAS_NEEDED_SYSTEM_PRIV_INCL_SYS_STAT)
OR HASSYSTEMPRIVILEGE (CURRENT_USER,
'BACKUP ADMIN') = 1
OR HASSYSTEMPRIVILEGE (CURRENT_USER,
'BACKUP OPERATOR') = 1 )
BY ENTRY_ID WITH READ ONLY
let me try to help you..It really confuse me when you say it is not a standard field . The column SYS_START_TIME is standard field having TIMESTAMP as data type and this would help in getting server local time of your backlog catalog.
try this way , may fix your problem : Windows - > Preference ->Runtime -> Result -> Format values .
Now run simple sql and check your column value after changing this format value , if format for that column got changed then as next step use the function TO_TIME to see expected result
Thanks
Siva
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.