| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Java Batching & Blobs
Vinnie,
Compared to the overhead of creating a BLOB the overhead of using a sequence is almost zero.
If you are concerned about having to issue (say)
"select myseq.nextval from dual"
1000 times you could do worse than:
"select myseq.nextval from bigtable where rownum <= 1000"
where bigtable is a table with a least 1000 rows. You''' get a cursor with 1000 unique numbers. This would avoid the sequence-hit-per-row problem you are concerned about.
Richard Graham.
> I have this situation:
> We are inserting many rows at a given time. Part of the data is a
> blob.
> We are using prepared statements & are thinking about batching the
> inserts.
> The problem is the PK is a sequence. Therefor we must go to the dB
> each time
> to grab the nextval so we can then do the BLOB update. Can anyone
> think of anyway to eliminate that extra call to the dB to grab the
> .nextval or is the performance hit small?
>
> Thanks
-- ------------------------------------------------------------------------ Remove FRUITBAT for a valid Email address.. www.orindasoft.com - makers of OrindaBuild which generates Java JDBC access code for calling PL/SQL Procedures.Received on Fri Aug 08 2003 - 13:35:22 CDT
![]() |
![]() |