I wrote a PL/SQL procedure to update the salary of the table Employee
create table Employee
(ID VARCHAR2(4 BYTE) NOT NULL,
First_Name VARCHAR2(10 BYTE),
Last_Name VARCHAR2(10 BYTE),
Start_Date DATE,
End_Date DATE,
Salary Number(8,2),
City VARCHAR2(10 BYTE),
Description VARCHAR2(15 BYTE)
)
/
And this is the procedure
CREATE OR REPLACE PROCEDURE update_employee_salary(
p_factor IN NUMBER
) AS
v_employee_count INTEGER;
BEGIN
UPDATE employee
SET salary = salary * p_factor;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
END update_employee_salary;
/
When I try to call the procedure
CALL update_employee_salary (1.5)
oracle displays ORA-00900: invalid SQL statement
It is incorrect way of calling procedure
. You can use the below method :
Begin
update_employee_salary(1.5);
End;
Read more here : PL/SQL Procedure