title: Invalid DataType Error for Proc SQL Query
body: <p>I'm creating a basic query using Oracle Pass Through and a macro loop.  It worked fine when I did Connect to Oracle, create table from connection but when I just try to use just the execute(DDL statements) by Oracle, it give me an invalid datatype error. I'm not sure how to fix it. I'm just creating tables from another existing table.  I'm using SAS EG for this particular program but just the code editor not the query builder. </p>
  
  <p>The &amp;STATES macro resolves to a list of states in a global macro I created</p>
  
  <p>I've written the same query successfully using the connect to Oracle, create table from connection pass through method but would like to also get it to work with just the execute method to see test which is more efficient. However, when I use the execute method, I get the datatype error.</p>
  
  <pre><code>%let NUM=2;      
  %let FT=LT;    
  %let STATES=&amp;&amp;STATESR&amp;NUM;  
  
  PROC SQL;
  connect to oracle(path=&amp;mydb user=&amp;USER pw=&amp;PW);
  
  %macro DTCNT() / parmbuff; 
  %let i=1;
  %let ST=%scan(&amp;SYSPBUFF,&amp;I);  
  
  %do %while (%str(&amp;ST)^=);
  
  execute(CREATE TABLE TMSIS_&amp;ST._&amp;FT._HDR_ADJDT_CNTS1 (bulkload=yes dbcreate_table_opts=nologging) AS
           SELECT adj_date,
                  count(*) as row_cnt 
           from mcd_r&amp;NUM._own.&amp;ST._&amp;FT._header_f
           group by adj_date
           order by adj_date) by oracle;
  
  execute (commit) by oracle;
  
        %let i=%eval(&amp;I+1);  
        %let ST=%scan(&amp;SYSPBUFF,&amp;I);
        %end;
  %mend DTCNT;
  %DTCNT(&amp;STATES);
  
  disconnect from oracle;
  QUIT;
  </code></pre>
  
  <p>ERROR: ORACLE execute error: ORA-00902: invalid datatype.</p>