Time stamps of rows
Posted in 2004
The poster wanted to identify rows inserted since a previous run, so an incremental unload could pick up only new rows, but the table had no insertion-order marker. Art Kagel suggested adding a SERIAL/SERIAL8 column (or an INTEGER fed by a sequence) and ordering by it. The poster said he couldn't alter the schema, so Uri Haham proposed a trigger writing the primary key plus a serial into a side table to track what's already been unloaded. Others debated whether adding a column was really impossible (4GL 'LIKE table.*' definitions can break). No confirmation of which approach was adopted.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Hi, I need to read rows which are inserted later than a particular row. eg; If i have the following rows f e c a x is it possible to read only the rows after c(i.e a,b). One way i feel is to know the timestamps of rows. Is there any other method to do so. Bye.
Add a serial (or if you have 9.xx a serial8 column or integer linked to a sequence) then you can order by that column. Art S. Kagel ----- Original Message ----- From: Parameshwar.... <pcdudyala@yahoo.com> At: 12/22 2:47 > Hi, > I need to read rows which are inserted later than a particular row. > eg; > > If i have the following rows > f > e > c > a > x > > is it possible to read only the rows after c(i.e a,b). > > One way i feel is to know the timestamps of rows. Is there any other method to > do so. > > > Bye.
Hi, I have the application running and i cannot alter the database schema. My requirement is, i have to unload the data from the table from the point where i stopped the last unload. for example if i have 10 rows today, i will unload the 10 rows based on a key value and store the last key value for further reference. When i start unload the next day, i should retrive from the 11th row. The problem, is i do not know in which order the key values are getting inserted into the table. Is there any other way out where i can achieve this. Bye. "ART KAGEL, BLOOMBERG/ 731 LEXIN" <KAGEL@bloomberg.net> wrote: Add a serial (or if you have 9.xx a serial8 column or integer linked to a sequence) then you can order by that column. Art S. Kagel ----- Original Message ----- From: Parameshwar.... At: 12/22 2:47 > Hi, > I need to read rows which are inserted later than a particular row. > eg; > > If i have the following rows > f > e > c > a > x > > is it possible to read only the rows after c(i.e a,b). > > One way i feel is to know the timestamps of rows. Is there any other method to > do so. > > > Bye. --------------------------------- Do you Yahoo!? Jazz up your holiday email with celebrity designs. Learn more.
Hi Perhaps you can create trigger on the table that put the primary key and serial/8 into side table. From it you can figure out which rows you haven't unload yet. Uri From: forum.subscriber@iiug.org on behalf of Chakravarth.... [pcdudyala@yahoo.com] Sent: Thursday, December 23, 2004 3:02 PM To: ids@iiug.org Subject: Re: Time stamps of rows [3909] Hi, I have the application running and i cannot alter the database schema. My requirement is, i have to unload the data from the table from the point where i stopped the last unload. for example if i have 10 rows today, i will unload the 10 rows based on a key value and store the last key value for further reference. When i start unload the next day, i should retrive from the 11th row. The problem, is i do not know in which order the key values are getting inserted into the table. Is there any other way out where i can achieve this. Bye. "ART KAGEL, BLOOMBERG/ 731 LEXIN" <KAGEL@bloomberg.net> wrote: Add a serial (or if you have 9.xx a serial8 column or integer linked to a sequence) then you can order by that column. Art S. Kagel
But why can't you alter the schema? A serial column could be added with the application running. "Uri Haham " <uri@comsoft.co.il> Sent by: forum.subscriber@iiug.org 12/23/2004 08:53 AM To: ids@iiug.org cc: Subject: Re: Time stamps of rows [3911] Hi Perhaps you can create trigger on the table that put the primary key and serial/8 into side table. From it you can figure out which rows you haven't unload yet. Uri From: forum.subscriber@iiug.org on behalf of Chakravarth.... [pcdudyala@yahoo.com] Sent: Thursday, December 23, 2004 3:02 PM To: ids@iiug.org Subject: Re: Time stamps of rows [3909] Hi, I have the application running and i cannot alter the database schema. My requirement is, i have to unload the data from the table from the point where i stopped the last unload. for example if i have 10 rows today, i will unload the 10 rows based on a key value and store the last key value for further reference. When i start unload the next day, i should retrive from the 11th row. The problem, is i do not know in which order the key values are getting inserted into the table. Is there any other way out where i can achieve this. Bye. "ART KAGEL, BLOOMBERG/ 731 LEXIN" <KAGEL@bloomberg.net> wrote: Add a serial (or if you have 9.xx a serial8 column or integer linked to a sequence) then you can order by that column. Art S. Kagel
Adding a column is dependent upon how the application is written. Some companies, like the one I am working for now as a contractor, are using Informix 4GL and prefer to use LIKE statements that refer to the entire table (DEFINE p_cust LIKE customer.*). Adding a column to this table while the application is running would quickly result in application runtime errors. Take care. Clifton JHAYS2@sears.com wrote: But why can't you alter the schema? A serial column could be added with the application running. "Uri Haham " Sent by: forum.subscriber@iiug.org 12/23/2004 08:53 AM To: ids@iiug.org cc: Subject: Re: Time stamps of rows [3911] Hi Perhaps you can create trigger on the table that put the primary key and serial/8 into side table. From it you can figure out which rows you haven't unload yet. Uri From: forum.subscriber@iiug.org on behalf of Chakravarth.... [pcdudyala@yahoo.com] Sent: Thursday, December 23, 2004 3:02 PM To: ids@iiug.org Subject: Re: Time stamps of rows [3909] Hi, I have the application running and i cannot alter the database schema. My requirement is, i have to unload the data from the table from the point where i stopped the last unload. for example if i have 10 rows today, i will unload the 10 rows based on a key value and store the last key value for further reference. When i start unload the next day, i should retrive from the 11th row. The problem, is i do not know in which order the key values are getting inserted into the table. Is there any other way out where i can achieve this. Bye. "ART KAGEL, BLOOMBERG/ 731 LEXIN" wrote: Add a serial (or if you have 9.xx a serial8 column or integer linked to a sequence) then you can order by that column. Art S. Kagel