I have the following codepublic class LPResultPersist {
public static long[] persist (Connection con, ArrayList<LPHeader> lps) throws Exception {
PreparedStatement itvlStmt = con.prepareStatement(
" INSERT /*+APPEND*/ INTO lp_itvl_stg ( "
+ " lp_header_stg_id "
+ " ,itvl_seq_num "
+ " ,itvl_status "
+ " ,itvl_ts "
+ " ) "
+ " VALUES ( "
+ " ? "
+ " ,? "
+ " ,? "
+ " ,? "
+ " ) ");
try {
for (int lpNum=0; lpNum < lps.size(); lpNum++) {
for (int itvlNum=0; itvlNum < lp.itvl.size(); itvlNum++) {
LPItvl itvl = lp.itvl.get(itvlNum);
itvlStmt.setLong( 1, loadId);
itvlStmt.setLong( 2, itvl.itvlSeqNum);
itvlStmt.setBytes( 3, new byte[]{itvl.itvlStatus});
} } // lpHeader
}
finally {
try {itvlPersistStatus = itvlStmt.executeBatch();} catch (SQLException e){}
}
return loadIds;
}
}
My question pertains to the APPEND hint in the insert statement. Does it do anything? I am absolutely certain that if you run this in SQL, the hint is ignored.INSERT /*+APPEND*/ INTO t VALUES(1);
It is only used with the INSERT INTO/SELECT FROM syntax. Does executeBatch() work around this somehow? I am guessing it doesn't, but I would like that confirmed.
Thanks,
Scott