title: COMMIT in Teradata Ansi Session Mode
body: <p>I have a requirement to pull data from Teradata to which I am connected in ANSI session mode. 
  The Teradata version is below 14, and therefore doesn't support more than one derived table using 'WITH' clause. Because of this limitation I am forced to create a temporary table, to which I load the data,and would like to use the data from the temp table. However, I get the </p>
  
  <blockquote>
    <p>3722 ERROR :  Only a COMMIT WORK or null statement is legal after a
    DDL Statement</p>
  </blockquote>
  
  <p>I tried having a <em>COMMIT</em>, <em>COMMIT WORK</em>, <em>SELECT null</em> and all of these keep throwing the same error. Note that I can't use BT; ET; since I am not on TERADATA session. And it isn't supported on ANSI session. </p>
  
  <p>This is the simplified version of the query that I would like to get working. </p>
  
  <pre><code>CREATE MULTISET VOLATILE TABLE temp_table AS
  (SELECT col FROM my_table)
  WITH DATA
  ON COMMIT PRESERVE ROWS;
  COMMIT; -- COMMIT; / COMMIT;/COMMIT WORK;/;
  SELECT * FROM temp_table;
  </code></pre>
  
  <p>Any ideas on how I could get this working?</p>
  
  <p>P.S : And yes, I would have to have the CREATE AND SELECT statement in a single request. It's a restriction we have because of the way we have our ETL process set up. </p>