Create 'TABLE AS' in PL/SQL block
<p>My query is simple but <code>PL/SQL</code> code block is expecting <code>'INTO'</code> statement.</p>

<p>Here is my query:</p>

<pre><code>DECLARE

yesterdays_date DATE := SYSDATE-1;
start_date DATE :='01/JAN/2013';

BEGIN     
     EXECUTE IMMEDIATE 'DROP TABLE P2P_DATA'; 
    EXCEPTION     
  WHEN OTHERS THEN         
   IF SQLCODE != -942 THEN     
 --if table not found DO NOTHING AND MOVE ON
 --dbms_output.put_line('HELLO');
            NULL;
    END IF;

---------------------------create new table here-------------------
CREATE TABLE P2P_DATA AS
SELECT 
    GM_NAME,
    NEW_SKILL,    
    WEEK_DATE,
    TOR_MWF
FROM TEST_TABLE 
WHERE WEEK_DATE BETWEEN start_date AND yesterdays_date;

END;
</code></pre>

<p>it gives the COMPILE time error:</p>

<pre><code>FOUND CREATE: EXPECTING END SELECT or (BEGIN CASE CLOSE CONTINUE DECLARE ... ETC)
</code></pre>

<p>I am simply setting the dates in the declaration block and then creating a new table as a result of the <code>select</code> statement. any ideas how to accomplish this task?</p>