Could you please help me on the below case. To append a string, below code can be used, for eg : v_str in the below case i.e the current entry for v_str is appended for the previously stored string value.
v_str := v_str ||'Total Records = 0 Processed = 0' || CHR(13) || CHR(10);
SELECT data_value INTO g_clob FROM ni_sim_order_artifact WHERE artifact_type = 60002 AND sim_order_fk = p_sim_order_pk FOR UPDATE;
DBMS_LOB.WRITEAPPEND(g_clob, length(v_str), v_str);
INSERT INTO NI_SIM_ORDER_HST values(ni_sim_order_hst_seq.nextval, p_sim_order_pk, GMTSYSDATE, p_user_id, 60003,'Moved to state Rejected, refer validation logs.');
UPDATE NI_SIM_ORDER SET STATUS=60003 WHERE ORDER_NUMBER=p_batch_number;
Could you please suggest a way in which I can prepend v_str value every time instead of appending.
For example :
Lets assume 1 was inserted, now in above statements if i want to insert 2 to ni_sim_order_artifact table then in current setup 1 is inserted and then 2. Please let me know a way to insert 1 initially and then 2 needs to be prepended to 1.