I am encountering issues when I try to submit queries while doing "CREATE VOLATILE TABLE" using the Teradata JDBC driver class. I have tried the solution described within:
http://forums.teradata.com/forum/database/jdbc-unable-to-create-a-volatile-table-using-a-java-client
but adding a commit statement didn't work for me.
Currently I am able to submit queries to Teradata directly by wrapping the query in parentheses and aliasing the query like below:
(SELECT * FROM database.table) AS TEMP_TABLE
If I don't wrap the query and alias it then I receive the following error:
[SQLState 42000] Syntax error, expected something like a name or a Unicode delimited identifier or '(' between the 'FROM' keyword and the 'SELECT' keyword.
But if I try to select from a volatile table using the query below(with or without the wrapping described above) :
CREATE VOLATILE MULTISET TABLE tmp AS ( SELECT * FROM padw.cr_plcy ) WITH DATA PRIMARY INDEX(CR_PLCY_ID) ON COMMIT PRESERVE ROWS; COMMIT; SELECT * FROM tmp;
My url connection string is : "jdbc:teradata://FOO/, TMODE=TERA,TYPE=FASTEXPORT,SESSIONS=10"
My driver class is : com.teradata.jdbc.TeraDriver
Without wrapping the query string in parentheses the error that is returned is :
Exception in thread "main" java.sql.SQLException: [Teradata Database] [TeraJDBC 15.00.00.20] [Error 3707] [SQLState 42000] Syntax error, expected something like a name or a Unicode delimited identifier or '(' between the 'FROM' keyword and the 'CREATE' keyword.
With wrapping the query string in parentheses the error that is returned is :
Exception in thread "main" java.sql.SQLException: [Teradata Database] [TeraJDBC 15.00.00.20] [Error 3707] [SQLState 42000] Syntax error, expected something like a name or a Unicode delimited identifier or a 'SELECT' keyword or '(' or a 'NONTEMPORAL' keyword or 'AS' keyword between '(' and the 'CREATE' keyword.
Is there something fundamental I am missing? Any help would be greatly appreciated.
Thanks,
Charles