Christian, you have things a bit easier with DB2, since it appears to
support only a single business time dimension [1]. This means that in the
query
SELECT * FROM mytable FOR BUSINESS_TIME AS OF ....
no information about temporal column names is needed, only the timestamps
of the filter.
In contrast, Oracle 12c (and SQL:2011) supports multiple valid time periods
( = business time) on a table. This means that they need to be named,
which in turn means that temporal queries need to specify the name of the
valid time period being queried.
SELECT * FROM mytable AS OF PERIOD FOR user_valid_time
TO_TIMESTAMP('01-Jun-10');
However, as in DB2 the column names of the actual time period do not need
to be provided, so that's less metadata to specify.
I suppose in theory there should be schema metadata available which would
provide the name of the valid time period(s), and if there was only one
then it could be used as the default. Not sure how this works via JDBC,
however.
[1]
http://www.ibm.com/developerworks/data/library/techarticle/dm-1204db2temporaldata/
On Thu, Nov 21, 2013 at 1:31 AM, Christian Mueller <
christian.muel...@os-solutions.at> wrote:
> I will give you an example:
>
> Given a normal select
>
> select * from table mytable where ....
>
> If this table has business time support it would be
>
> select * from table mytable as of business_time of '2011-01-01' where ....
>
> The syntax extension is in the "from" clause. The above query returns only
> records valid at '2011-01-01'. A simple
>
> select * from table mytable where ...
>
> would return all historical versions, this is unwanted in most scenarios.
> If the date is missing it should be
>
> select * from table mytable as of business_time of current time where ...
>
> This select returns all actual versions.
>
>
> The second dimension is system time support. DB2 uses a second table to
> store modified and deleted records. This happens completely behind the
> scenes, no java coding necessary. System time support uses the current time
> stamp of the operating system.
>
> The select would be
>
> select * from table mytable as of system_time of '2011-01-01' where ....
>
> Last not least, you can combine those 2 histories, having a "logical"
> history and "physical" one. This is called bitemporal and gives you the
> possibility to reconstruct the logical history on the fly for each
> physical point in time.
>
> For business time , there are some syntax extensions for delete and update.
>
> delete from mytable for portion of business time from '2011-01-01' to
> '2012-01-01' where ....
>
> For insert statments, you have to specify from and to as usual.
>
>
>
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users