in my table i will update only 100 record among 1000
records i need to display recently updated record'.....can u
tell me where those records are stored how can i display
those records...?if there is any sql query pls let me know....?

Answers were Sorted based on User's Feedback



in my table i will update only 100 record among 1000 records i need to display recently updated re..

Answer / kingmanish

Generally while updating rows in table we also update te
sourcr by which the rows were update( like program id)

also upadate date etc.

we can retrive the records having timestamp of the time the
rows were updated or the program name which was used to
update the table

Is This Answer Correct ?    1 Yes 0 No

in my table i will update only 100 record among 1000 records i need to display recently updated re..

Answer / adarsha

Use the DB2 COPY Utility with Incremental Image copy.. which
give you the latest update done to a prticular table/table
space from last update .. below is the utility step

COPY TABLESPACE DSN8D51A.DSN8S51E
FULL NO
SHRLEVEL CHANGE

Use jcl for that

Is This Answer Correct ?    2 Yes 2 No

in my table i will update only 100 record among 1000 records i need to display recently updated re..

Answer / vikram

Use the below query to fetch first 100 rows among 1000 rows ,

select * from table order by column desc fetch first 100 rows

column is either timestamp or id

so the above query gives recent 100 updated rows.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

Explain in brief how does db2 determine what lock-size to use?

0 Answers  


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

4 Answers   Mphasis,


Say CUST Table contains records like: CUSTNO CUSTNAME CUSTLOC 100 ABC SSS 200 XYZ 300 PQR 400 MNO WWW 500 CVV ------------- ------------- Now write a query to retrieve all records with CUSTLOC no data.

3 Answers   IBM,


What is subquery ?

6 Answers  


What is REORG? When is it used?

4 Answers  






What keyword does an SQL SELECT statement use for a string search?

2 Answers  


how many bytes timestamp token occupies?

6 Answers   Boss Global, Cap Gemini, TCS,


What is isolation level?

4 Answers  


For unmatched rows returned from an outer join, the column values in the other table are set to null e.g If A OUTER JOIN B returns some unmatched rows from A, the corresponding column values in B will be set to null. What can be done so that a null value is not displayed for these columns?

3 Answers  


Where would you find information about the type of database authority held by the user?

2 Answers  


What is the SQL Communications Area and what are some of its key fields?

1 Answers  


Can we install 2 different versions of Db2 on same mainframe?

3 Answers  


Categories