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!

How to use SQLCODE -54

user5345Jun 27 2009 — edited Jul 5 2009
hi,
can any one help me in using sqlcode -54 in exceptions. this is my code below.
PROCEDURE SELLING_PRICE_UPDATE IS
BEGIN
declare
l_item_id number;

cursor c1 is
select jbm.item_id, po_currency_code, jbm.organization_id
from jnpp_barcode_master jbm, jnpp_item_master jim
where jbm.bar_code = :jnpp_grv_lines.bar_code
and jbm.organization_id = jim.organization_id
and jbm.item_id = jim.item_id
and jbm.organization_id in (select organization_id
from jnpp_inv_org_master
where org_id = 21)
for update nowait;

begin
for r1 in c1 loop
update jnpp_item_master
set po_currency_code= r1.po_currency_code
where item_id = r1.item_id
and organization_id = r1.organization_id;

update jnpp_barcode_master
set po_currency_code= r1.po_currency_code
where bar_code = :jnpp_grv_lines.bar_code
and organization_id = r1.organization_id;

end loop;

exception
-- here i need to use sqlcode -54. please any one help me.

when sqlcode = -54 then
return error (error: other users working on this record, cannot update).
when others then
raise form_trigger_failure;
end;

END;

thnxs
siva
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2009
Added on Jun 27 2009
6 comments
2,789 views