RE: Db2 find last record inserted

RE: Db2 find last record inserted

 

  

The difference between select count(*) and select card from syscat.tables
is that the first query gives you the count of the existing records on the table, and the second one gives you the count of the records of the table that were there when statistics
Were run.


Merry Xmas to you and to all DBA's and DB2 programmers.

Pedro Gonçalves.

-----Mensagem original-----
De: Thomas Erdenberger [mailto:db2udbdba-ezmlmshield-x90187568.[Email address protected]
Enviada: quinta-feira, 23 de Dezembro de 2004 15:01
Para: LazyDBA Discussion
Assunto: RE: Db2 find last record inserted

Hi all,

why would there be a difference between "select count(*)..." and "select card from syscat.tables" ? Shouldn't they be in sync? If not, how often and when is syscat.tables being updated?

Cheers,
Thomas


> Subject: RE: Db2 find last record inserted
> From: "Saravana_Ganesan " <db2udbdba-ezmlmshield-x28005462.[Email
> address protected]
> Date: Mon, 20 Dec 2004 16:27:55 +0530
> To: "LazyDBA Discussion" <[Email address protected]
>
>
> hi sachin,
> you can write a script with the following algorithm 1.do
> runstats on all the tables before your start of updation.
> 2.repeat step 3,4 for each table
> 3.find the difference between "select count(*) from table" and "select
> card from syscat.tables"
> 4.if there is a difference then that table is updated
>
>
> regards,
> saravana.
>
>
> -----Original Message-----
> From: Sachin Kumar
> [mailto:db2udbdba-ezmlmshield-x29346911.[Email address protected]
> Sent: Monday, December 20, 2004 4:05 PM
> To: LazyDBA Discussion
> Subject: Db2 find last record inserted
>
>
> Hi All,
>
> I have a Db2 UDB 8.1 databse with around 180 tables. One of my user
> inserts a row in a certain table. How can i find out which table and
> which row has been updated ? Which table/view should be queried ??
>
> regards
> Sachin
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
> **********************************************************************
> **** This email (including any attachments) is intended for the sole
> use of the intended recipient/s and may contain material that is
> CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance
> by others or copying or distribution or forwarding of any or all of
> the contents in this message is STRICTLY PROHIBITED. If you are not
> the intended recipient, please contact the sender by email and delete
> all copies; your cooperation in this regard is appreciated.
> **********************************************************************
> ****
>
>
>

--
"The Guide is definitive. Reality is frequently inaccurate."


---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


DB2 & UDB email list listserv db2-l LazyDBA home page