473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to find table modification time?


How do I find out when the table was modified?
When I look at syscat.tables it only lists creation time.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 10 '06 #1
9 16948

What I am meant was how to find out time when data in the table was modified
(insert/update/delete).

While stranded on information super highway Hemant Shah wrote:
>
How do I find out when the table was modified?
When I look at syscat.tables it only lists creation time.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 10 '06 #2
AFAIK, there is no 'inbuilt' feature to support this ..

You will have to maintain it 'manually', say using an additional field
in your table, or capture the data changes using triggers or may be one
row/table table to record data change times ..

Sathyaram

Hemant Shah wrote:
What I am meant was how to find out time when data in the table was modified
(insert/update/delete).

While stranded on information super highway Hemant Shah wrote:

How do I find out when the table was modified?
When I look at syscat.tables it only lists creation time.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 10 '06 #3
I agree w/ Sathyaram, and just to amplify what he's said, a typical way
to do what you want is to create columns in each table such as the
following

ROW_CREATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_CREATE_USER NOT NULL DEFAULT CURRENT_USER

ROW_UPDATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_UPDATE_USER NOT NULL DEFAULT CURRENT_USER

the latter two being populated by a trigger on subsequent updates
(unless you're using ORM, your flavor of which may have a centralized,
proprietary, way of doing this).

--Jeff

Sathyaram Sannasi wrote:
AFAIK, there is no 'inbuilt' feature to support this ..

You will have to maintain it 'manually', say using an additional field
in your table, or capture the data changes using triggers or may be one
row/table table to record data change times ..

Sathyaram

Hemant Shah wrote:
What I am meant was how to find out time when data in the table was modified
(insert/update/delete).

While stranded on information super highway Hemant Shah wrote:
>
How do I find out when the table was modified?
When I look at syscat.tables it only lists creation time.
>
>
>
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 10 '06 #4
While stranded on information super highway jefftyzzer wrote:
I agree w/ Sathyaram, and just to amplify what he's said, a typical way
to do what you want is to create columns in each table such as the
following

ROW_CREATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_CREATE_USER NOT NULL DEFAULT CURRENT_USER

ROW_UPDATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_UPDATE_USER NOT NULL DEFAULT CURRENT_USER

the latter two being populated by a trigger on subsequent updates
(unless you're using ORM, your flavor of which may have a centralized,
proprietary, way of doing this).

--Jeff

Thanks all for the info. My client is migrating from VSAM on mainframe to
DB2 on AIX. On mainframe they were able to tell when the file changed, and
they were looking for similar feature for DB2 table.

I think just one column with default timestamp should satisfy them.

>
Sathyaram Sannasi wrote:
>AFAIK, there is no 'inbuilt' feature to support this ..

You will have to maintain it 'manually', say using an additional field
in your table, or capture the data changes using triggers or may be one
row/table table to record data change times ..

Sathyaram

Hemant Shah wrote:
What I am meant was how to find out time when data in the table was modified
(insert/update/delete).

While stranded on information super highway Hemant Shah wrote:

How do I find out when the table was modified?
When I look at syscat.tables it only lists creation time.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 10 '06 #5
Hemant Shah wrote:
Thanks all for the info. My client is migrating from VSAM on mainframe to
DB2 on AIX. On mainframe they were able to tell when the file changed,
and they were looking for similar feature for DB2 table.
You could do something similar on AIX as well: find the containers of the
tablespace in which the table resides and check the container's stats.
However, that is highly unreliable (and I would think the same applies to
mainframe as well) because not all data may have been written to disk yet,
or changes are written to disk that may be rolled back later on.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Oct 11 '06 #6
Row timestamps show when the data was modified but, for large tables,
may not be a good way to track the last modified time. Either you will
need an index on the column or a tablescan to determine the most recent
update timestamp.

Phil Sherman

Hemant Shah wrote:
While stranded on information super highway jefftyzzer wrote:
>I agree w/ Sathyaram, and just to amplify what he's said, a typical way
to do what you want is to create columns in each table such as the
following

ROW_CREATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_CREATE_USER NOT NULL DEFAULT CURRENT_USER

ROW_UPDATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_UPDATE_USER NOT NULL DEFAULT CURRENT_USER

the latter two being populated by a trigger on subsequent updates
(unless you're using ORM, your flavor of which may have a centralized,
proprietary, way of doing this).

--Jeff


Thanks all for the info. My client is migrating from VSAM on mainframe to
DB2 on AIX. On mainframe they were able to tell when the file changed, and
they were looking for similar feature for DB2 table.

I think just one column with default timestamp should satisfy them.

>Sathyaram Sannasi wrote:
>>AFAIK, there is no 'inbuilt' feature to support this ..

You will have to maintain it 'manually', say using an additional field
in your table, or capture the data changes using triggers or may be one
row/table table to record data change times ..

Sathyaram

Hemant Shah wrote:
What I am meant was how to find out time when data in the table was modified
(insert/update/delete).

While stranded on information super highway Hemant Shah wrote:
How do I find out when the table was modified?
When I look at syscat.tables it only lists creation time.
>
>
>
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 11 '06 #7
While stranded on information super highway Knut Stolze wrote:
Hemant Shah wrote:
> Thanks all for the info. My client is migrating from VSAM on mainframe to
DB2 on AIX. On mainframe they were able to tell when the file changed,
and they were looking for similar feature for DB2 table.

You could do something similar on AIX as well: find the containers of the
tablespace in which the table resides and check the container's stats.
However, that is highly unreliable (and I would think the same applies to
mainframe as well) because not all data may have been written to disk yet,
or changes are written to disk that may be rolled back later on.
I though about that, but they are using only one tablespace for all the
tables.
>
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 11 '06 #8
While stranded on information super highway Phil Sherman wrote:
Row timestamps show when the data was modified but, for large tables,
may not be a good way to track the last modified time. Either you will
need an index on the column or a tablescan to determine the most recent
update timestamp.

Phil Sherman
Yes, I would need to create index on the column.

I have another question about the column. If I create a column with
default value of current timestamp. Will the timestamp get automatically
updated when the data in the row is updated?

I know it will get default value when the row is inserted.
>
Hemant Shah wrote:
>While stranded on information super highway jefftyzzer wrote:
>>I agree w/ Sathyaram, and just to amplify what he's said, a typical way
to do what you want is to create columns in each table such as the
following

ROW_CREATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_CREATE_USER NOT NULL DEFAULT CURRENT_USER

ROW_UPDATE_TS NOT NULL DEFAULT CURRENT_TIMESTAMP
ROW_UPDATE_USER NOT NULL DEFAULT CURRENT_USER

the latter two being populated by a trigger on subsequent updates
(unless you're using ORM, your flavor of which may have a centralized,
proprietary, way of doing this).

--Jeff


Thanks all for the info. My client is migrating from VSAM on mainframe to
DB2 on AIX. On mainframe they were able to tell when the file changed, and
they were looking for similar feature for DB2 table.

I think just one column with default timestamp should satisfy them.

>>Sathyaram Sannasi wrote:
AFAIK, there is no 'inbuilt' feature to support this ..

You will have to maintain it 'manually', say using an additional field
in your table, or capture the data changes using triggers or may be one
row/table table to record data change times ..

Sathyaram

Hemant Shah wrote:
What I am meant was how to find out time when data in the table was modified
(insert/update/delete).
>
While stranded on information super highway Hemant Shah wrote:
>How do I find out when the table was modified?
>When I look at syscat.tables it only lists creation time.
>>
>>
>>
>--
>Hemant Shah /"\ ASCII ribbon campaign
>E-mail: No************@xnet.com \ / ---------------------
> X against HTML mail
>TO REPLY, REMOVE NoJunkMail / \ and postings
>FROM MY E-MAIL ADDRESS.
>-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
>I haven't lost my mind, Above opinions are mine only.
>it's backed up on tape somewhere. Others can have their own.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Oct 11 '06 #9
Hemant Shah wrote:
I have another question about the column. If I create a column with
default value of current timestamp. Will the timestamp get automatically
updated when the data in the row is updated?
No, it won't. Either the UPDATE statements take care of it (unreliable) or
you add a trigger (reliable).

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Oct 12 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff J. | last post by:
The basic concept is a music playlist that I'm trying to write as a table inside a div. I have Song and Playlist 'classes'. The Song class has a Write() method, as does the Playlist. The...
3
by: stan | last post by:
I am working on some documentation in html format and I would really like to display the date the html file, itself was modified. I am writing my documentation in vi and the html server involved is...
3
by: mahajan.sanjeev | last post by:
Hi All, I am using a SQLTransaction to insert records into a table. At one time, there are 5000 or more records to be inserted one by one. It takes some 20-25 mins for the entire process to run....
3
by: John Baker | last post by:
Hi: At the outset let me admit that I screwed up! I have built a rather elaborate set of forms and sub forms starting with a client table, and going down to PO and Line item. This works very...
3
by: Ray | last post by:
I had a query of table and achived it as a table a week's ago. Now I need to find out if there are any modifications on the records against the achived table. The modification might be one or...
3
by: shahram.shirazi | last post by:
Hi guys, I was wondering if someone could help me a bit here. Im trying to desing an electronic register system for a school. In terms of the table design, I obviously need a Student Details...
6
by: Ivan | last post by:
Hello to all and thanks for answer to my topics. I made one stored procedure that delete one table, but when call/execute the procedure this show SQL0532N A parent row cannot be deleted...
9
by: erick-flores | last post by:
If you have access to the database that the linked table is in, modify it there. You can't modify a linked table. Alternatively, you can import the linked table, then it won't be linked any more...
3
by: dmorand | last post by:
I'm very new to stored procedures so this is probably something very dumb. I want to pass a name of a table to be created to my stored procedure. I'm using the variable @tableName in the code below...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.