Sunteți pe pagina 1din 3

Re: 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....? Answer
#1
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

0 Yes 0 No
Is This Answer Correct ?

Re: in a table consist of 1000 records among that i was updated 145 record how
could i know that ..list of recently updated record's and where could i see those
updated record's....pls help me out.... Answer
#2
SQLERRD Contains the number of rows affected by a
DB2
INSERT/DELETE operation. if the operation is
DELETE, this
contains number of rows deleted after the
execution of the
query.

Re: how will i display the duplicate record's from a table... i don't want to
eliminate ...i want to display the duplicate record...for example in my table i have 10
record's like record no(1,2,3,4,2,9,6,1) in this ...so i want to receive duplicates...
Answer
#1
SELECT <Column Name1> FROM Table
GROUP BY <Column Name1> HAVING COUNT(*)>1;
Re: How will fetch last 5 rows from table in db2 Answer
#1
SELECT * FROM (SELECT * FROM T ORDER BY pk DESC
FETCH FIRST 5 ROWS) AS X
ORDER BY PK;

Is This Answer Correct ?


2 Yes 7 No
Re: can we update the table by using cursors can anyone post the query? Answer
#2
Yes you can update the table using cursor....
for eg: if you want to update 3 columns like A,B,C
the you
can write as:

Update Table_name
Set A = :Host varaible(value)
B = :Host varaible(value)
C = :Host varaible(value)
where current of C1(Cursor name)

2 Yes 0 No
Is This Answer Correct ?

Re: when iam reading a flat file which has 100 records
through cobol program when iam reading 50th records it gets
abends .. so when i run the program again it should read from
50th record .where it got abened ? how it is possible Answer
#1
WHEN EVER THERE IS AN ERROR / ABEND IN THE
CODE(50TH
RECORD), BEFORE THE PROGRAM STOPS, WWRITE
THAT RECORD INTO
TEMP (PRE DEFINEED AND CREATED) FILE.
eVERY TIME THE
PROGRAM IS RUN, CHECK THE TEMP FILE, IF
THE TEMP FILE IS
EMPTY, THEN CODE IS NOT ABENDED., IF THE
TEMP FILE HAS
VALUES, READ THE TEMP FILE, PASS THE KEY
VALUES FROM IT TO
FLAT FILE AND DO A READ. ., AND PERFORM
OPRATIONS FOR ALL
OTHER RECORDS AFTER THAT RECORD.

0 Yes 0 No
Is This Answer
Correct ?

S-ar putea să vă placă și