Hi Again,
I have updated my script with the following. I was able to create the SP successfully but there was an error when trying to call it.
===============================================
CREATE PROCEDURE session.T1_SPx()
LANGUAGE SQL
BEGIN
declare v_parentid BIGINT;
declare v_name VARCHAR(50);
declare v_body CLOB;
declare c1 cursor for
select parentid, name, body
from session.CELL2_TMP
order by parentid
for update of body;
open c1;
cell_loop:
LOOP
fetch c1 into v_parentid, v_name, v_body;
UPDATE session.CELL2_TMP
SET body = replace(body,'R("' concat v_name concat '")','')
WHERE current of c1;
END LOOP cell_loop;
close c1;
commit;
END@
===============================================
The error is
===============================================
SQL0508N The cursor specified in the UPDATE or DELETE statement is not positioned on a row.
===============================================
Any idea what could be the problem?
Many thanks again for the help!
[-]