title: Create Teradata volatile table and select from table using isql
body: <p>I am trying to submit a two-statement SQL file as a batch job to the isql utility on a Linux machine. </p>
  
  <p>The first statement defines a <code>VOLATILE TABLE</code> and the second statement is a <code>SELECT</code> statement against this table.</p>
  
  <p>The Teradata server is hosted on a remote machine and I have successfully run <code>SELECT</code> statements to return result sets to my host.</p>
  
  <p>Below is an example of the SQL file.</p>
  
  <pre><code>CREATE MULTISET VOLATILE TABLE my_temp_table AS (
    SELECT 
      A.ID
      , MIN(A.DTE) AS FIRST_DATE
    FROM (
      SELECT
        X.ID
        , MIN(X.STRT_DTE) AS DTE
      FROM DATABASE0.TABLE_ABC AS X
      WHERE X.STRT_DTE BETWEEN (CURRENT_DATE - 7) AND CURRENT_DATE
      GROUP BY X.ID
      UNION ALL
      SELECT
        Y.ID
        , MIN(Y.STRT_DTE) AS DTE
      FROM DATABASE0.TABLE_XYZ AS Y
      WHERE Y.STRT_DTE BETWEEN (CURRENT_DATE - 7) AND CURRENT_DATE
      GROUP BY Y.ID
    ) AS A
  GROUP BY A.ID
  )
  WITH DATA
  ON COMMIT PRESERVE ROWS
  ;
  SELECT TOP 10 * FROM my_temp_table;
  </code></pre>
  
  <p>When I run the following command</p>
  
  <pre><code>cat my_two_statement_query.sql | isql -v -b -d',' mydsn myuid mypwd
  </code></pre>
  
  <p>I receive the following error</p>
  
  <p><code>[25000][Teradata][ODBC Teradata Driver][Teradata Database] Data definition not valid unless solitary.</code></p>
  
  <p>I am able to run these statements in Teradata client applications - Studio and SQL Assistant - with no issues.  </p>
  
  <p>UPDATE: I've included the contents of the odbc.ini file</p>
  
  <pre><code>[ODBC]
  InstallDir=/path/to/installation/dir
  Trace=0
  TraceDll=/path/to/dll/odbctrac.so
  TraceFile=/path/to/tracefile/odbc_trace.log
  TraceAutoStop=0
  
  [ODBC Data Sources]
  proddsn=tdata.so
  
  [proddsn]
  Driver=/path/to/driver/tdata/so
  Description=Teradata database
  DBCName=TDPROD
  LastUser=
  Username=
  Password=
  Database=DATABASE0
  DefaultDatabase=DATABASE0
  NoScan=Yes
  </code></pre>