Thank you Mr. Simon for your comment I will try that and see the results.
Kindly Regards,
James Kitambara
On Tuesday, 14 December 2021, 13:59:01 GMT+3, Simon Riggs <simon.riggs@enterprisedb.com> wrote:
On Fri, 10 Dec 2021 at 15:40, James Kitambara
<jameskitambara@yahoo.co.uk> wrote: > > There is no COMMIT in the loop for processing cursor data. > > Sorry I forget to share the procedure on my first email: > > Here is a procedure: > ------------------------------------------------------- > > CREATE OR REPLACE PROCEDURE public.temp_insert_in_books2( > ) > LANGUAGE 'edbspl' > SECURITY DEFINER VOLATILE PARALLEL UNSAFE > COST 100 > AS $BODY$ > --v_id INTEGER; > v_title CHAR(10); > v_amount NUMERIC; > CURSOR book_cur IS > SELECT title, amount FROM books2 WHERE id >=8; > BEGIN > OPEN book_cur; > LOOP > FETCH book_cur INTO v_title, v_amount; > EXIT WHEN book_cur%NOTFOUND; > INSERT INTO books2 (title, amount) VALUES (v_title, v_amount); > END LOOP; > COMMIT; > CLOSE book_cur; > END > $BODY$;