Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Oracle documentation clearly states this:</p> <pre><code> If you are performing an INSERT with the VALUES clause, specify the APPEND_VALUES hint in each INSERT statement immediately after the INSERT keyword. Direct-path INSERT with the VALUES clause is best used when there are hundreds of thousands or millions of rows to load. The typical usage scenario is for array inserts using OCI. Another usage scenario might be inserts in a FORALL statement in PL/SQL </code></pre> <p>.</p> <p>So answer to your question is APPEND_VALUES hint. I can see in your post that you have tried it but can't make out what problem you faced.</p> <p>Also this assertion in your post is not correct "<strong>From what I understand, direct path inserts only supports the subquery syntax and not the VALUES clause</strong>." Oracle documentation gives this example : </p> <p>The following PL/SQL code fragment is an example of using the APPEND_VALUES hint:</p> <pre><code>FORALL i IN 1..numrecords INSERT /*+ APPEND_VALUES */ INTO orderdata VALUES(ordernum(i), custid(i), orderdate(i),shipmode(i), paymentid(i)); COMMIT; </code></pre> <p>Link for oracle documentation: <a href="http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables004.htm#i1009100" rel="nofollow">http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables004.htm#i1009100</a></p> <p>Sample Code:</p> <pre><code>dbConnection.setAutoCommit(false);//commit trasaction manually String insertTableSQL = "INSERT /*+ APPEND_VALUES */ INTO DBUSER" + "(USER_ID, USERNAME, CREATED_BY, CREATED_DATE) VALUES" + "(?,?,?,?)"; PreparedStatement = dbConnection.prepareStatement(insertTableSQL); preparedStatement.setInt(1, 101); preparedStatement.setString(2, "test1"); preparedStatement.setString(3, "system"); preparedStatement.setTimestamp(4, getCurrentTimeStamp()); preparedStatement.addBatch(); preparedStatement.setInt(1, 102); preparedStatement.setString(2, "test2"); preparedStatement.setString(3, "system"); preparedStatement.setTimestamp(4, getCurrentTimeStamp()); preparedStatement.addBatch(); preparedStatement.executeBatch(); dbConnection.commit(); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload