I am trying to run execute immediate statement to create a table and after that I want to insert data to it but it shows me an error that my table doesn't exist:
DECLARE
liczba NUMBER :=5;
BEGIN
IF liczba > 1 THEN
EXECUTE IMMEDIATE 'CREATE TABLE person (name VARCHAR2(10))';
INSERT INTO person VALUES ('John');
END IF;
END;
The error is as follows:
ORA-06550: line 9, column 17: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 9, column 5: PL/SQL: SQL Statement ignored
Is it possible to insert data without adding next execute immediate statement?
Why doesn't it see the table?