Subject | Re: [ib-support] Accessing current transaction start timestamp |
---|---|
Author | Yahoo Groups |
Post date | 2002-11-11T20:38:06Z |
At 11/11/2002 10:37 AM (Monday), lelegaifax wrote:
Create an integer field in each table. Create triggers which fill this
field with a generated value for every insert (and update if you want to
track modifications).
Now change previous_export_timestamp to highest_value_exported. For each
table, perform a select to obtain the records where generated_field >=
highest_value_exported and insert them into the destination database.
Perform another "select max(generated_field)" from the table and keep track
of the highest value you ever get across all tables. (Alternatively look at
each record as it is inserted into the destination and track the highest
generated_field value.)
When you are done save the highest value for generated_field you
encountered back into highest_value_exported.
>The ideal would be getting the exact timestamp of a). Is it at allI would solve this problem by using a generator.
>possible? If not, how could I circumvent the problem?
Create an integer field in each table. Create triggers which fill this
field with a generated value for every insert (and update if you want to
track modifications).
Now change previous_export_timestamp to highest_value_exported. For each
table, perform a select to obtain the records where generated_field >=
highest_value_exported and insert them into the destination database.
Perform another "select max(generated_field)" from the table and keep track
of the highest value you ever get across all tables. (Alternatively look at
each record as it is inserted into the destination and track the highest
generated_field value.)
When you are done save the highest value for generated_field you
encountered back into highest_value_exported.