All,
We have a situation where we have a view that selects data from a table. Lets say the colums are:
BEGIN_TIMESTAMP , END_TIMESTAMP, UNIQUE_KEY, etc....
there is alot of other logic that goes on in the view to create the output dataset we need, suffice to say we're stuck on one particular aspect. In the situation whereby the BEGIN_TIMESTAMP and END_TIMESTAMP cross an hour - I.e. BEGIN_TIMESTAMP = '01/01/2007 3:55' and END_TIMESTAMP = '01/01/2007 4:05' we will need to split that into two returned rows, One with BEGIN_TIMESTAMP = '01/01/2007 3:55' and END_TIMESTAMP = '01/01/2007 4:00' - the second row having BEGIN_TIMESTAMP = '01/01/2007 4:00' and END_TIMESTAMP = '01/01/2007 4:05'.
The crux of the issue is that we'd like to do all of this in a self-contained manner not using a temporary table if possible because of the nature of the datasource we are tapping into. Can we do this sort of logic directly within the view or directly within a procedure/function that the view uses without involving temporary tables?
Looking for any insight you guys may have...
We have a situation where we have a view that selects data from a table. Lets say the colums are:
BEGIN_TIMESTAMP , END_TIMESTAMP, UNIQUE_KEY, etc....
there is alot of other logic that goes on in the view to create the output dataset we need, suffice to say we're stuck on one particular aspect. In the situation whereby the BEGIN_TIMESTAMP and END_TIMESTAMP cross an hour - I.e. BEGIN_TIMESTAMP = '01/01/2007 3:55' and END_TIMESTAMP = '01/01/2007 4:05' we will need to split that into two returned rows, One with BEGIN_TIMESTAMP = '01/01/2007 3:55' and END_TIMESTAMP = '01/01/2007 4:00' - the second row having BEGIN_TIMESTAMP = '01/01/2007 4:00' and END_TIMESTAMP = '01/01/2007 4:05'.
The crux of the issue is that we'd like to do all of this in a self-contained manner not using a temporary table if possible because of the nature of the datasource we are tapping into. Can we do this sort of logic directly within the view or directly within a procedure/function that the view uses without involving temporary tables?
Looking for any insight you guys may have...
Comment