1.

Write PL/SQL code block to increment the employee’s salary by 1000 whose employee_id is 102 from the given table below.

Answer»
EMPLOYEE_IDFIRST_NAMELAST_NAMEEMAIL_IDPHONE_NUMBERJOIN_DATEJOB_ID SALARY
100ABCDEFabef98765432102020-06-06 AD_PRES24000.00
101GHIJKLghkl9876543211 2021-02-08AD_VP17000.00
102MNO PQRmnqr98765432122016-05-14AD_VP17000.00
103STUVWXstwx98765432132019-06-24IT_PROG9000.00
DECLARE employee_salary NUMBER(8,2); PROCEDURE update_salary ( EMP NUMBER, salary IN OUT NUMBER ) IS BEGIN salary := salary + 1000; END;BEGIN SELECT salary INTO employee_salary FROM ib_employee WHERE employee_id = 102; DBMS_OUTPUT.PUT_LINE ('Before update_salary procedure, salary is: ' || employee_salary); update_salary (100, employee_salary); DBMS_OUTPUT.PUT_LINE ('After update_salary procedure, salary is: ' || employee_salary);END;/

RESULT:

Before update_salary procedure, salary is: 17000After update_salary procedure, salary is: 18000


Discussion

No Comment Found