0% found this document useful (0 votes)
25 views

Cursor

This PL/SQL block defines a cursor to display a list of employees from the emp table. It loops through the cursor, fetching each row and outputting the employee number, name, job, hire date, salary, and department number. When executed, it displays this information for all employees in the table.

Uploaded by

Manidhar Cool
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Cursor

This PL/SQL block defines a cursor to display a list of employees from the emp table. It loops through the cursor, fetching each row and outputting the employee number, name, job, hire date, salary, and department number. When executed, it displays this information for all employees in the table.

Uploaded by

Manidhar Cool
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Program No: 9 Aim: Program in PL/SQL block in Cursor to display List of Employees from Emp able!

Cursor to display List of Employees from Emp able: "NP# : declare cursor c is select * from emp; r c%rowtype; begin open c; dbms_output.put_line('empno loop fetch c into r; exit when c%notfound; dbms_output.put_line(r.empno ' ' r.ename ' ' r.job ' ' r.hiredate ' ' r.sal ' ' r.deptno); end loop; end; ename job r.hiredate sal deptno');

$ES#L : !"#$ set ser%eroutput on !"#$ &prg.s'l empno ()*+ (5++ (84(8** (*+2 ((43 ename smith allen ward jones bla,e scott job cler, r.hiredate sal deptno 43 )3 )3 43 )3 )3

-(./01.23 233

salesman 43.607.2- -*33 salesman 44.607.2- -483 manager 34.9:;.2- 4+(8 manager 3-.<9=.2- 4283 analyst -5.<9;.2- 4333

()48

ford

analyst

-8.>[email protected]

-233

43

:#A!"# procedure successfully completed.

You might also like