title: Teradata JDBC Create Volatile Table error 3585
body: <p>I have never used the Teradata JDBC driver before, so I may be running into something very obvious...</p>
  
  <p>Basically, I am trying to create a volatile table from which I can query.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li><p>Maybe I just can't run <code>CREATE VOLATILE TABLE</code> statements like this...  What am I doing wrong?</p></li>
  <li><p>Maybe the driver version is too old? (Currently 12.00.00.110)</p></li>
  </ol>
  
  <p><strong>Java code</strong></p>
  
  <pre><code>PreparedStatement  pstmtCreateVT = dbConn.prepareStatement(util.getQuery("CREATE_VOLATILE_TABLE_ABC"));
     pstmtCreateVT.setInt(1, 7);
     pstmtCreateVT.setInt(2, 11);
     pstmtCreateVT.executeQuery();
  </code></pre>
  
  <p><strong>Query.properties</strong></p>
  
  <pre><code>CREATE_VOLATILE_TABLE_ABC = \
  CREATE VOLATILE TABLE ABC \
  AS ( SELECT DISTINCT t1.NAME \
    , lookup.price \
  FROM SUPERMARKET.FRUITS t1 \
    INNER JOIN SUPERMARKET.PRICING lookup \
      ON 
        lookup.price BETWEEN ? AND ? \
  ) \
  WITH DATA NO PRIMARY INDEX \
  ON COMMIT PRESERVE ROWS ;
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>2013-11-15 09:55:19,220 DEBUG [CreatePoolingConnection.createConnection:102] url: jdbc:teradata://&lt;&lt;some_url_here&gt;&gt;/DATABASE=SUPERMARKET,ENCRYPTDATA=ON,TMODE=ANSI
  2013-11-15 09:55:19,673 ERROR [BOMPartsApplicability.fetch:245] ERROR:
  com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 12.00.00.110] [Error 3585] [SQLState HY000] USING modifier NOT allowed with DDL.
     at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:277)
     at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:102)
     at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:285)
     at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:176)
     at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:108)
     at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:99)
     at com.teradata.jdbc.jdbc_4.Statement.executeStatement(Statement.java:309)
     at com.teradata.jdbc.jdbc_4.Statement.prepareRequest(Statement.java:467)
     at com.teradata.jdbc.jdbc_4.PreparedStatement.&lt;init&gt;(PreparedStatement.java:53)
     at com.teradata.jdbc.jdbc_4.TDSession.createPreparedStatement(TDSession.java:506)
     at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalPreparedStatement.&lt;init&gt;(TeraLocalPreparedStatement.java:84)
     at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.prepareStatement(TeraLocalConnection.java:328)
     at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.prepareStatement(TeraLocalConnection.java:149)
     at GroceryStore.SetupFruits.fetch(BOMPartsApplicability.java:147)
     at GroceryStore.SetupFruits.main(BOMPartsApplicability.java:359)
  </code></pre>