title: ORACLE Batching DDL statements within a Execute Immediate
body: <p>I'm trying to run multiple ddl statements within one Execute Immediate statement.
  i thought this would be pretty straight forward but it seems i'm mistaken.</p>
  
  <p>The idea is this:</p>
  
  <pre><code>declare v_cnt number; 
  
  begin 
  
  select count(*) into v_cnt from all_tables where table_name='TABLE1' and owner = 'AMS'; 
  
  if v_cnt = 0 then 
  
  execute immediate 'CREATE TABLE TABLE1(VALUE VARCHAR2(50) NOT NULL)  ALTER TABLE TABLE1 ADD (MYVAL2 NVARCHAR2(10))'; 
  
  end if; 
  
  end;
  </code></pre>
  
  <p>however this results in an error</p>
  
  <blockquote>
    <p>ORA-00911: invalid character
    ORA-06512: at line 10</p>
  </blockquote>
  
  <p>Each of the statements within the batch run fine if i execute them by themselves. and if i take this statement and execute it, it will run fine (with the ; between the 2 statements). If i remove the ; between statements i get a different error about invalid option</p>
  
  <p>the plan is that i'll be able to build a table, export the table schema for this table including all it's alter statements, and then run the batch against another system as part of an install/update process. </p>
  
  <p>So, how do i batch these DDL statements within a single execute immediate? Or is there a better way to do what i'm needing? </p>
  
  <p>I'm a bit of a Oracle newb, i must admit. Thank you all for your patience. </p>