0

I am creating sample code using java form which first executing query "set long 100000" and after immediate executing get_ddl query for getting schema of index using batch operation.

My sample code are:-

     Statement stmt2 = con.createStatement();
       ResultSet rs2 =null;                             
       String query = "set long 100000";
       stmt2.addBatch(query);
       query = "set longchuncksize 100000";
       stmt2.addBatch(query);          
       int[] i=stmt2.executeBatch();
       queryForScript = "SELECT DBMS_METADATA.GET_DDL('INDEX','INDEX_NAME','SCHEMA_NAME') FROM dual";

        rs2 = stmt2.executeQuery(queryForScript);

When i execute code it throws following error :-

ORA-00922: missing or invalid option exception

Please suggest how can i execute query using batch operation in java.

I have also refer following post ORA-00922: missing or invalid option when execute “set long 100000” statement in oracle

santosh
  • 435
  • 1
  • 7
  • 24

0 Answers0