Cursor for update get stuck while running the program
user021May 28 2011 — edited May 30 2011Dear
i am using below mention program but work and get stuck. please any idea how can reslove this.
declare
l_segment1 VARCHAR (100);
CURSOR req_number_cur
IS
SELECT TO_CHAR (current_max_unique_identifier + 1)
FROM po_unique_identifier_control
WHERE table_name = 'PO_REQUISITION_HEADERS'
FOR UPDATE OF current_max_unique_identifier;
BEGIN
fnd_client_info.set_org_context (101);
mo_global.set_policy_context ('S', 101);
dbms_output.put_line('testing');
begin
OPEN req_number_cur;
FETCH req_number_cur
INTO l_segment1;
IF req_number_cur%NOTFOUND
THEN
--do something
NULL;
--insert statement
UPDATE po_unique_identifier_control
SET current_max_unique_identifier = current_max_unique_identifier + 1
WHERE CURRENT OF req_number_cur;
END IF;
CLOSE req_number_cur;
end;
END;
---thanks
appreciate you help.