Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Query Question
"mike" <hillmw_at_charter.net> a écrit dans le message de
news:1110563007.190233.249590_at_g14g2000cwa.googlegroups.com...
| So, you are suggesting I create a sql loop. The example they gave was:
|
| DECLARE
| CURSOR dept_cur IS
| SELECT deptno
| FROM dept
| ORDER BY deptno;
| -- Employee cursor all employees for a dept number
| CURSOR emp_cur (v_dept_no DEPT.DEPTNO%TYPE) IS
| SELECT ename
| FROM emp
| WHERE deptno = v_dept_no;
| BEGIN
| FOR dept_rec IN dept_cur LOOP
| dbms_output.put_line('Employees in Department
| '||TO_CHAR(dept_rec.deptno));
| FOR emp_rec in emp_cur(dept_rec.deptno) LOOP
| dbms_output.put_line('...Employee is '||emp_rec.ename);
| END LOOP;
| END LOOP;
| END;
|
http://www.google.fr/groups?selm=7r006n%24nko%241%40oceanite.cybercable.fr&output=gplain
Regards
Michel Cadot
Received on Fri Mar 11 2005 - 12:17:44 CST
![]() |
![]() |