Re: Query



***** NEW FEATURE REQUEST ********

Why doesn't Informix implement some sort of timestamp type? Or put in
an easier faster mechanism to do this?

CreateTime datetime year to second default current,
ModifiyTime timestamp year to second

bozon wrote:
I wonder which is faster. I might benchmark this if I get a chance.

Art S. Kagel wrote:
bozon wrote:
You don't happen to know a better way to get that timestamp for the
update trigger. It seems like a hassle to create a procedure that just
returns current and then calling it from the trigger.

Usually do as Doug C. does and perform an explicit update in the trigger.

Art

Art S. Kagel wrote:

Superboer wrote:

We are migrating our database, and there is a change in schema.
So the new table me have a column which was not there earlier.
After the migration will be done we bring the system live. Now if
anything goes wrong then we have to take the system to the previous
position with NEW DATA WHICH WAS INSERTED OR UPDATED AFTER THE
MIGRATION.


in other words the only thing you do not need is the added
columns???!!!
right.??

in that case alter table ... drop ....

No, Chandan wants to know: "If the new DB has some problems after
implementation and we decide to fall back to the original DB, how can I
recover new rows and updates to existing rows from the new DB so I can
reapply them to the original without having to reload the entire large data
set?"

Bozon nailed it. A timestamp column with a DEFAULT CURRENT and UPDATE
trigger to restamp updated rows. This cannot trap deletes, but they are
easier to find then updates (obviously no harder than finding new rows
though). To locate deletes directly Chandan will need an audit table to
record the deleted key via a delete trigger.

Art S. Kagel



.



Relevant Pages

  • Re: Query
    ... returns current and then calling it from the trigger. ... After the migration will be done we bring the system live. ... A timestamp column with a DEFAULT CURRENT and UPDATE ... To locate deletes directly Chandan will need an audit table to ...
    (comp.databases.informix)
  • [PATCH 11/14] IIO: max1363 add software ring buffer support using ring_sw
    ... * to this driver currently ensuring that the timestamp is stored at an 8 ... * occur before we disable the ring buffer (and hence would have no idea ... Some triggers will generate their own time stamp. ... * trigger was set far too high and the reads then locked up the computer. ...
    (Linux-Kernel)
  • Re: Beware: Timestamps are not contained inside Transactions!!
    ... table might be to get it within the scope of a trigger, ... create table stamp ... > Our databases have tables that use a Timestamp column for row-level> concurrency checking. ... > The steps we used to recreate/test this scenario follows:> 1 - A transaction is opened and a new record is inserted into table A> 2 - On a separate connection, another transaction is opened and a new record> is inserted into table B ...
    (microsoft.public.sqlserver.server)
  • Re: Beware: Timestamps are not contained inside Transactions!!
    ... table might be to get it within the scope of a trigger, ... create table stamp ... > Our databases have tables that use a Timestamp column for row-level> concurrency checking. ... > The steps we used to recreate/test this scenario follows:> 1 - A transaction is opened and a new record is inserted into table A> 2 - On a separate connection, another transaction is opened and a new record> is inserted into table B ...
    (microsoft.public.sqlserver.programming)
  • Re: Question about triggers
    ... I want to format my value before insert ... the value is a timestamp ... my trigger do not work (:((( ... What you need to do is, upon loading the data from the csv file, ...
    (comp.databases.oracle.misc)