I'm trying to check if table exists and if not, then I want to create it. But I'm still getting this error:
Error report -
ORA-06550: řádka 30, sloupec 28:
PL/SQL: ORA-00942: tabulka nebo pohled neexistuje
ORA-06550: řádka 30, sloupec 3:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
My code is:
SELECT COUNT(*) into cnt FROM dba_tables WHERE owner = 'CENTRUMADMIN' and table_name = 'AUD$_BACKUP';
DBMS_OUTPUT.PUT_LINE(cnt);
IF (cnt <= 0) THEN
EXECUTE IMMEDIATE 'CREATE TABLE CENTRUMADMIN.AUD$_BACKUP AS select * from SYS.AUD$ where 1=2';
DBMS_OUTPUT.PUT_LINE('Vytvorena tabulka AUD$_BACKUP ve shematu CENTRUMADMIN:');
END IF;
This code is inside my procedure for cleaning audit trail.
Can anyone pls help? Thanks in advance!