validtimetemporal
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| validtimetemporal [2015/07/22 09:54] – z0hpvk | validtimetemporal [2025/03/08 22:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Valid Time Temporal ===== | ===== Valid Time Temporal ===== | ||
| + | ==== Create Tables ==== | ||
| Create a period using existing columns | Create a period using existing columns | ||
| < | < | ||
| Line 18: | Line 19: | ||
| PERIOD FOR student_module_period | PERIOD FOR student_module_period | ||
| );</ | );</ | ||
| + | |||
| + | ==== Viewing Data ==== | ||
| We can now create **AS OF PERIOD FOR** queries.\\ | We can now create **AS OF PERIOD FOR** queries.\\ | ||
| The below query finds all students on a currently active course. | The below query finds all students on a currently active course. | ||
| - | < | + | < |
| - | PERIOD FOR student_module_period SYSDATE sm;</ | + | Can also create **VERSIONS PERIOD FOR ... BETWEEN** queries.\\ |
| + | The below query finds all students that were active in the last week. | ||
| + | < | ||
| + | student_module_period BETWEEN TRUNC(SYSDATE)-7 AND TRUNC(SYSDATE);</ | ||
| + | |||
| + | ==== Using Flashback ==== | ||
| + | You can also use the DBMS_FLASHBACK_ARCHIVE.ENABLE_AT_VALID_TIME procedure | ||
| + | < | ||
| + | DBMS_FLASHBACK_ARCHIVE.ENABLE_AT_VALID_TIME (' | ||
| + | END; | ||
| + | |||
| + | BEGIN | ||
| + | DBMS_FLASHBACK_ARCHIVE.ENABLE_AT_VALID_TIME (' | ||
| + | END; | ||
| + | |||
| + | BEGIN | ||
| + | DBMS_FLASHBACK_ARCHIVE.ENABLE_AT_VALID_TIME (' | ||
| + | END;</ | ||
validtimetemporal.1437558861.txt.gz · Last modified: (external edit)
