on 02-16-2018 1:48 PM
Hi All,
Do we have to explicitly specify any format specific to HANA datetime for converting a decimal column in SQL server(Source) to Datetime column in HANA(Target)
I placed a temporary table in SQL server and was able to convert the decimal value to datetime
Source Column Data:
20171005153731
to_date(Query.AUDITSTARTTIME,'YYYYMMDDHH24MISS')
Target Column in SQL Server Table
2017.10.05 15:37:31.000000000
But when I try to use to_date function for HANA column mapping it doesnt work
Any inputs would be appreciated with karma points
Regards
Arun Sasi
What's the generated SQL code in both cases? Is the SQL pushed down to the database?
That will all make a difference. An implicit conversion will always be done, if you don't explicitly specify the format. So you may be lucky, you may be not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Dirk!!
The below conversion works fine to_date(cast(AUDIT_START_TIME,'varchar(24)'), 'YYYYMMDDHH24MISS')
If we simply do the below conversion, it will print NULL as HANA does not understand the character conversion, therefore we have to cast it as varchar(24).
to_date(to_char(AUDIT_START_TIME, 'YYYYMMDDHH24MISS'), 'YYYYMMDDHH24MISS')
In both the cases DS generates does not add any conversion function (SQL in Validate SQL) for the Audit Start Time and Audit End Time columns
Regards
Arun Sasi
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.