Hi all,Could anyone let me know the equivalent code in pl/sql for this java code? I really appreciate that.for (int i = 0; i < 10; i++) {if (i == 5){continue;}} thanks,kamalnayan.M

Showing Answers 1 - 12 of 12 Answers

vijaya

  • Jul 6th, 2006
 

select *

from a

where i=(select i from a

where i<10) and i=5;

  Was this answer useful?  Yes

amit

  • Jul 10th, 2006
 

DECLARE

  I   INTEGER(2);

BEGIN

  FOR I = 0..10 LOOP

     ...

     IF I = 5 THEN

         EXIT;

     END IF

END

  Was this answer useful?  Yes

Ray

  • Jul 12th, 2006
 

BEGIN

FOR i in 0 .. 9 LOOP

    IF i = 5 THEN

      EXIT;

    END;

  END LOOP;

END;

  Was this answer useful?  Yes

ganne

  • Aug 1st, 2006
 

begin
for i in 1..10 loop
if i=5 then
 update emp set sal=sal+100;
 end if;
 end loop;
 end;

  Was this answer useful?  Yes

Rama Krishna.Y

  • Aug 9th, 2006
 

Hi Kamal!!

       This may help you...

for i in 0..9 loop

if i=5 then

break;

end if;

end loop;

Thanks&Regds

Ramki,TCS,Hyd

  Was this answer useful?  Yes

Murali

  • Sep 25th, 2006
 

Hi, This can be done in this way also...

as there is no equivalent keyword called "break" or "continue"..instead we can write it in other fashion...here it goes

begin
for i in 1..10 loop
if i=5 then

NULL; //do nothing(continues the loop without exiting from the for loop)
end if;
end loop;
end;

this will definitely work....:-)

madhu

  • Feb 9th, 2007
 

I hope this will work..
declare
i number(2);
Begin
for i in 1.. 10
loop
if (i ==5) then

else
exit;
end loop;
end;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions