ora-00942 table or view does not exist in stored procedure
CREATE OR REPLACE PROCEDURE p
Is
CURSOR C
Is
SELECT *
From Scott.emp
For UPDATE;
BEGIN
For V_temp in C
LOOP
IF (V_temp.deptno = 10)
Then
UPDATE scott.emp
SET sal = sal + 10
WHERE Current of C;
elsif (V_temp.deptno = 20)
Then
UPDATE scott.emp
SET sal = sal + 20
WHERE Current of C;
ELSE
UPDATE scott.emp
SET sal = sal + 50
WHERE Current of C;
END IF;
END LOOP;
COMMIT;
END;
An error occurred while creating the stored procedure using toad:
Warning:compiled but with compilation errors.
The print error is: ora-00942:table or view does not exist
I checked the information and I didn't know.
sys.fga_log$ is the basic table that records FGA audit records.
Workaround:
Log in as SYS and give the system the right to select and delete sys.fga_log$, otherwise the stored procedure below will be added with a problem.
Sql> Grant Select, delete on sys.fga_log$ to system;
Creating a stored procedure with toad error and resolving