Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: How to pass dates and times to HANA with oData?

$
0
0

It seems, that there is no easy way to transfer the current date and time via odata to HANA. I found the following solution for my requirement:

 

1) Get a readable timestamp in the Python code. With readable I mean a format DD.MM.YYYY HH:MM:SS in contrast to the 13-digit unix timestamp:

 

timestamp = time.strftime("%d.%m.%Y %H:%M:%S", localtime(time.time()))

2) Create in HANA a table with field timestamp of type varchar(23). Then create / activate the oData Service and THEN create two additional generated columns of type time and date:

 

Unbenannt.PNG

 

It is important to activate the odata Service BEFORE the generated columns are added: These two columns DATE and TIME must not be  contained in the metadata of the odata service, because otherwise the odata service would try to fill them with null values which leads to an error.

 

Regards,

Ingo


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>