I have a table which has thousand of records i want to
fetch only record num 100 to record num 200. Write a query
that satisfies this criteria.(Cant use any keys)
Anyone please reply ASAP!
Answer Posted / om prakash yadav
Note= Before i given the query it is worng pleas ignopre it.
Thanks.
========================================
using cursors you can do>
CURSOR Crs_trs IS
SELECT empno, empname, sal, deptno from emp WHERE empno
between 100 and 200;
vr_empno.empno%type;
vr_empname.empname%type;
vr_sal.sal%type;
vr_deptno.deptno%type;
BEGIN
OPEN Crs_trs;
IF crs_trs%ISOPEN THEN
LOOP
FETCH Crs_trs INTO vr_empno, vr_empname, vr_sal, vr_deptno;
dbms_output.put_line('empno__'||vr_empno );
dbms_output.put_line('empname__'||vr_empname);
dbms_output.put_line('empsalary__'||vr_empsal );
dbms_output.put_line('empdeptno__'|| vr_deptno);
EXIT WHEN Crs_trs%NOTFOUND;
END IF;
END LOOP;
CLOSE Crs_trs;
END;
| Is This Answer Correct ? | 1 Yes | 9 No |
Post New Answer View All Answers
What is schema in db2?
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What is copy pending status in db2?
What is buffer pool in the db2 database?
i want to maintain uniqueness on pdf without make lf??????????
What is lock escalation in db2?
Which component is responsible for processing sql statements and selecting access paths?
What is the physical storage length of date data type?
What is table space in db2?
Define declaration generator (dclgen).
What is the physical storage length of timestamp data type?
What is cobol db2?
what is utility for parm lib
How to fetch the last row from the table in SQL (db2)?
How do you pull up a query which was previously saved in qmf?