Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET SERVEROUTPUT ON;
- DECLARE
- v_salary NUMBER(0);
- BEGIN
- SELECT salary INTO v_salary FROM employees -- We select from the table of employees the value of salary and put in variable v_salary
- WHERE employee_id = 100; -- we can not put all salaries in one variable, so we select the salary of the employee id equal with 100
- DBMS_OUTPUT.PUT_LINE(v_salary); -- we output the salary stored in the variable
- EXCEPTION
- END;
Advertisement