Docstoc

cur11 - DOC

Document Sample
cur11 - DOC Powered By Docstoc
					sal integer:=0;
begin
open emp;
loop
fetch emp into e,n,j,m,d,p,dp;
exit when emp%notfound;
sal:=p+p*.2;
insert into emp1 values(e,n,j,m,d,sal,dp);
end loop;
end;

SQL> truncate table emp1;
Table truncated.

SQL> ed cursor1;
SQL> @ cursor1;

enterr value for departmentcode: 33
  2: cursor emp is select empno,ename,job,managerno,joindate,pay,deptno from
employee where dept
  2: cursor emp is select empno,ename,job,managerno,joindate,pay,deptno from
employee where dept

SQL procedure successfully completed.


SQL> select * from emp1;

 EMPNO ENAME JOB MANAGERNO JOINDATE PAY DEPTNO
 --------- ------------------------- ------------------------------ --------- --------- ---------

 1003            Holley      analyst            3            03-FEB-99        7800        33

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:10/17/2012
language:
pages:1
Description: oracle, sql