What is the best way to search in a CLOB, in batch operation ?
Hi All,
My application runs batch procedure for searching 'text' into clobs (column notes in the below query) and accordingly inserts into another table-
code snippet is like this -
FORALL i IN 1 .. l_snme_sn_temp.COUNT
INSERT INTO snme_rmanotes_out
(report_request_id, serial_number, scrubbed_sn, product_id, pk1_value, last_update_date, event_date, event)
SELECT pi_report_request_id
, l_snme_sn_temp_orig (i).
, l_snme_sn_temp (i)..
, '' product_id
, pk1_value
, TO_CHAR (last_update_date, 'DD-MON-YYYY') last_update_date
, TO_CHAR (last_update_date, 'DD-MON-YYYY') event_date
, 'IN RMA NOTES' event
FROM c3_rma_notes
WHERE contains (notes, l_snme_sn_temp (i)) > 0; **
here - l_snme_sn_temp contains the text that the query searches ( also evident from the where clause, marked **), and is a variable of a TYPE.
I am populating l_snme_sn_temp in a chunk of 500 ( using bulk collect limit 500) from a table having at least 1 million records (and the upper cap will not be more than 1.5 M).
The procedure that does this, takes 24+ hours to complete.
If you guys have any better way to do this or any idea to tune to reduce time kindly suggest.
I'd appreciate your kind response.
regards,
Raj Pandit