Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

How to setup a table with Time constraint

$
0
0

Hi,

how to create a table with time constraint in SAP HANA so with validity period for the set of keys? I have not managed to link together the begin and end date to form a validity interval which particularly in HR tables is a must in order to pick up the record which is valid on a specific date.


So taking a simple example; the keys of the table are EMPLOYEEID and the time range between the BEGIN and END dates.

So this would be possibe;

EMPLOYEEID / BEGINDATE / ENDDATE / VALUE

12345678 / 2013-01-01 / 2013-12-31 / ValueA

12345678 / 2014-01-01 / 2014-09-16 / ValueB

12345678 / 2014-09-17 / 2014-12-01 / ValueC

23456789 / 2010-01-01 / 2015/01-01 / ValueA

...


but this would not as it violates the time constraint of the key(s) as the dates overlap:

12345678 / 2014-01-01 / 2014-12-31 / ValueA

12345678 / 2014-02-02 / 2014-09-16 / ValueB

...


Please note that just defining the BEGIN and END dates as keys is not sufficent as per in the above example we could not just look at the individual days as values but to the date interval they comprise. 


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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