Q:

Write a program in PL/SQL to display a table based detail information for the employee of ID 149 from the employees table

0

Write a program in PL/SQL to display a table based detail information for the employee of ID 149 from the employees table.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

DECLARE 
    z_employee employees%ROWTYPE; 
BEGIN 
    SELECT * 
    INTO   z_employee -- INTO clause always notifies only single row can be fetch 
    FROM   employees 
    WHERE  employee_id = 149; 

    dbms_output.Put_line('Employee Details :   ID:' 
                         ||z_employee.employee_id 
                         ||'  Name: ' 
                         ||z_employee.first_name 
                         ||' ' 
                         ||z_employee.last_name 
                         ||'  Salary:  ' 
                         ||z_employee.salary); 
END; 
/
Sample Output:
SQL> /
Employee Details :   ID:149  Name: Eleni Zlotkey  Salary:  10500

PL/SQL procedure successfully completed.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now