PL/SQL Program to Accept Employee Number & Display Employee Details

PL/SQL Program to Accept Employee Number & Display Employee Details:

declare
no number;
name varchar(15);
salary number(10);
deptname varchar(15);
begin
no:=:no;
dbms_output.put_line('Employee Id is: '||no);
select ename,sal,dname into name,salary,deptname from emp e,dept d where e.deptno=d.deptno and empno=no;
dbms_output.put_line(name||' '||salary||' '||deptname);
end;


OUTPUT:

Employee Id is: 7839
KING 5000 ACCOUNTING

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.