问题
When i run SQL query in oracle sql developer it is work, but in jdbc this query doesn't work and catch the java.sql.SQLSyntaxErrorException: ORA-00922: missing or invalid option. Could anyone help me ? There is my query below
CREATE GLOBAL TEMPORARY TABLE MY_TABLE (
ID VARCHAR2(30 BYTE) PRIMARY KEY,
NAME VARCHAR2(20 BYTE));
INSERT INTO MY_TABLE (
ID, NAME)
VALUES ('My_Id' , 'My_Name' );
回答1:
It is just a quick guess, because I have no oracle available to proof it, but with MyBatis (which is based on JDBC) I had this behavior with the last ;
. Please try to remove it in your JDBC query.
Please create the temporary table in a first statement, then in a second statement add your data.
来源:https://stackoverflow.com/questions/30818416/ora-00922-missing-or-invalid-option-when-trying-to-insert-into-table