Orders.ship_date = case when '' = '' then DATE else '' end If they enter a standard date the code resolves to this: A user will either enter a standard date, or they will enter the magic date. (Teradata offers several options to return the date for “today” and DATE is the example I selected here.) One of two things will happen in this condition. I’ve used Teradata syntax here but the concept applies to any database. Orders.ship_date = case when shipping date','D',mono,free) = '' then DATE else shipping date','D',mono,free) end Here’s what the code looks like (I will explain it after): Suppose that my magic date is January 1, 1900, as I mentioned before. Imagine that I have a report that is designed to show orders that shipped today. □ The magic comes in when I create the condition object that includes that prompt. There’s nothing magical about that prompt. In this prompt I am asking for a shipping date, I am expecting a valid date value, there is no list of values, and the user will enter only one value. It might look something like shipping date','D',mono,free) Once I have selected my magic date I can now create my prompt using the basic five parameters. That is the first important point about this concept: I must pick a date that will never appear as part of my normal data. Quite frequently I will use something like January 1, 1900, as it is highly unlikely that any of my records will include that date as a valid entry. What I do is define a specific date as the magic date. That’s where the concept of a “magic date” comes from. I can’t put the word “Today” in this prompt, as “Today” is not anywhere close to being a valid date. That means that anything entered in that date prompt field has to pass the basic validation that will be done by the application. A ‘D’ designates a prompt as a date value. When I set up a prompt in the universe, one of the required arguments is the datatype. Can I make that happen?įirst, a quick recap. In a nutshell: I need a way to accept a prompt value and convert it to today’s date for user convenience and for scheduling. I have a long series of posts on how to create some dynamic date objects that can be used for scheduling, but those were not prompts. When I schedule a report, I have to provide values for every prompt. It is also essential for scheduled reports, which is something I didn’t really touch on last time. This would allow my users to click-n-go on the report without having to update the date value each time. I would like to be able to provide a default value of today’s date. In case you don’t want to read the entire post, here is the executive summary:Īt the end of that post I mentioned something called a “magic date” that I frequently use in my universes to get past this limitation. In the first post on designing universe prompts I talked about the idea of having a default date value present in a prompt. Transaction Isolation x=0 r 1 (x=0) r 2 (x=0) w 2 (x=x+20) w 1 (x=x+10) x=30 x=10 Lost Update: w 1 (x=10) r 2 (x=10) abort 1 =w 1 -1 (x) w 2 (x=x+10) x=0 x=10 x=20 Dirty Read: x=0 y=0 x=0 y=10 Inconsistent Read: r 1 (x=0) w 2 (x=5) w 2 (y=10) r 1 (y=10) Read/Write, Write/Read, Write/Write are not commutableĬC Protocols Basic Timestamp Ordering (BTO) each transaction i obtains a t i timestamp right away operations are executed in the scheduled order r i (x) : if t i ≥ w-time(x) then schedule else abort i w i (x) : if t i ≥ max /* timestamp data, part of transaction*/ /*either directly or by X -id- t X mapping */ for each d in V I do d. Transaction (ACID contract) Atomicity (all or nothing in case of a failure) begin acc 1 -= money acc 2 += money commit Consistency rollback updates upon a failed consistency check Isolation mask inconsistent intermediate state resulting from concurrent execution Durability commit ted updates must be failure-resilient Notions of Time Transaction-time is defined as the time when a fact is stored in the database that allows for as-of queries Valid-time is defined when a fact becomes effective (valid) in reality Bitemporal databases support both of above current account balance, employee's salary A temporal DB supports a time domain and is thus able to manage time varying data real-time stock quotes employee's salaries between 19 Temporal DB A conventional DB captures only the most current state of modeled world e.g. temporal Temporal databases: valid-time, transaction-time Databases and transactions (AC I D principles) ( Optimistic ) concurrency control: TO, … ( Pessimistic ) concurrency control: 2PL, … Timestamping in transaction-time databases Timestamping and strong 2PL (SS2PL) Timestamping in distributed setting (2PC) Timestamping since SQL-92 ( CURRENT_TIME ) Ĭonventional vs. German Shegalov Transaction Timestamping in Temporal Databases FR Informatik Graduiertenkolleg Ringvorlesung, May 26 th, 2003 based on the research by D. Transaction Timestamping in Temporal Databases
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |