plsql - Nested cursors in oracle -


i got stored procedure in oracle

create or replace procedure mayor_sueldo   cursor c_depto select deptno dept;   c_deptno dept.deptno%type;   c_empno number;   c_ename emp.ename%type;   c_job emp.job%type;   c_sal emp.sal%type; begin   open c_depto;   fetch c_depto c_deptno;   while ( c_depto%found )loop     select empno, ename, job, sal c_empno, c_ename, c_job, c_sal emp sal = (select max(sal) emp where(deptno = c_deptno) );     dbms_output.put_line( c_empno||'-'||c_ename||'-'||c_job||' '||c_sal );     fetch c_depto c_deptno;   end loop; close c_depto; end; 

the problem inside query inside while block if query returns 1 , 1 row there no problem when query return more 1 row thinking use cursor idk how. please me

maybe help: for _row in (select ....) loop dbms_output(_row.a || ..); end loop;


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -