I am trying to run the following EXECUTE IMMEDIATE statement
'SELECT PARTITION_NAME '
|| ' FROM DBA_TAB_PARTITIONS WHERE PARTITION_NAME = :a'
|| ' AND TABLE_NAME = :b'
|| ' AND TABLESPACE_NAME = :c';
DBMS_OUTPUT.put_line( SELECTSTATEMENT );
EXECUTE IMMEDIATE SELECTSTATEMENT INTO V_PARTITION_NAME USING P_PARTITION_NAME, P_ORACLE_TABLE, 'TS_CIF_SOLUTION2';
Unfortunately I receive the following error
ORA-00942: table or view does not exist
However I have ran this statement outside of the EXECUTE IMMEDIATE and do not receive the error. I have used FROM SYS.DBA_TAB_PARTITIONS as well to specify the owner. I also have privileges to this table.