Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cursor for update get stuck while running the program

user021May 28 2011 — edited May 30 2011
Dear

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2011
Added on May 28 2011
9 comments
683 views