0% found this document useful (0 votes)
10 views1 page

PL 12

The document contains a SQL query that retrieves all records from the 'employees12' table, displaying employee details such as ID, name, position, salary, and date of birth. It also includes a PL/SQL block that prompts for an employee ID, retrieves the corresponding employee's name, post, and salary, and outputs this information. An example execution for employee ID 101 is provided, showing the output for employee 'sneha'.

Uploaded by

sakshipangul6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

PL 12

The document contains a SQL query that retrieves all records from the 'employees12' table, displaying employee details such as ID, name, position, salary, and date of birth. It also includes a PL/SQL block that prompts for an employee ID, retrieves the corresponding employee's name, post, and salary, and outputs this information. An example execution for employee ID 101 is provided, showing the output for employee 'sneha'.

Uploaded by

sakshipangul6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Program:-

select * from employees12;

ID EMPNAME POST SALARY DOB


---------- ---------- ---------- ---------- ---------
101 sneha developer 800000 23-OCT-94
102 pooja developer 70000 13-AUG-95
103 priya manager 600000 10-JAN-00

declare
2 empId number:=&id;
3 empName varchar(10);
4 empPost varchar(10);
5 empSal varchar(10);
6 begin
7 select empname,post,salary into empName,empPost,empSal from employees12
where id=empId;
8 dbms_output.put_line('Name ' || empName);
9 dbms_output.put_line('Post ' || empPost);
10 dbms_output.put_line('Salary ' || empSal);
11* end;
SQL> /
Enter value for id: 101
old 2: empId number:=&id;
new 2: empId number:=101;

PL/SQL procedure successfully completed.

SQL> set serveroutput on;


SQL> /
Enter value for id: 101
old 2: empId number:=&id;
new 2: empId number:=101;
Name sneha
Post developer
Salary 800000

PL/SQL procedure successfully completed.

You might also like