| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> URGENT: Problem with cursor
Hello,
When I execute the following code, the cursor doesn't retreive any row, but If I execute the select in svrmgrl a row is retrevied to me.
Does anyone know the reason?
Thank you.
Joan Sánchez
cursor cLOCK(plILCK baan.ttisfc962998.t$ilck%TYPE, plETID baan.ttisfc962998.t$etid%TYPE) is
select t$item,t$cdad from ttisfc962998 where t$etid<>3 and t$ilck=14 and rownum=1;
sITEM_LOCK baan.ttisfc962998.t$item%TYPE;
lCDAD_LOCK baan.ttisfc962998.t$cdad%TYPE;
sITEM_2_LOCK baan.ttisfc962998.t$item%TYPE;
lCDAD_2_LOCK baan.ttisfc962998.t$cdad%TYPE;
BEGIN
update ttisfc962998 set t$ilck=lILCK where t$etid=lETID and
t$ilck=0;
if SQL%FOUND then /* Si se modifica devolver un rdo */
open cLOCK(lILCK,lETID);
if cLOCK%FOUND then
fetch cLOCK into sITEM_LOCK, lCDAD_LOCK;
select t$item, t$cdad into sITEM_2_LOCK,lCDAD_2_LOCK from
baan.ttisfc962998 where t$etid=lETID;
if sITEM_2_LOCK <> sITEM_LOCK then /* Como el art es
diferente -> rollback */
update baan.ttisfc962998 set t$ilck=0 where t$ilck=lILCK
or t$etid=lETID;
return 3; /* Artículo diferente con 1º et.int. de
la secuencia */
end if;
if lCDAD_2_LOCK <> lCDAD_LOCK then /* Como la cdad es
diferente -> rollback */
update baan.ttisfc962998 set t$ilck=0 where t$ilck=lILCK
or t$etid=lETID;
return 2; /* Cdad diferente con 1º et.int. de la
secuencia */
end if;
return 0; /* Etiq.int. bloqueada y comprobada */
else
return 0; /* Al ser la primera etiq.int. y
bloquearse, se devuelve OK */
end if;
else
update ttisfc962998 set t$ilck=0 where abs(t$ilck)=lILCK;
return 1;
end if;
EXCEPTION
WHEN others THEN
return 4;
update baan.ttisfc967998 set t$ilck=0; -- Etiq.Odettes LANZADAS
update baan.ttisfc962998 set t$ilck=0; -- Etiq.Internas
LANZADAS
update baan.ttisfc963998 set t$ilck=0; -- Etiq.Internas
UBICADAS
update baan.ttisfc964998 set t$ilck=0; -- Etiq.Internas
PREPARADAS
RETURN 1;
EXCEPTION
WHEN OTHERS THEN
RETURN 0;
![]() |
![]() |