Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Infinite loops possible in PL/SQL?

Infinite loops possible in PL/SQL?

From: Shmooth <shmooth_at_yahoo.com>
Date: 2000/05/22
Message-ID: <3929B7F8.F7EDC038@yahoo.com>#1/1

I'm trying to produce an infinite loop using PL/SQL. Is this possible?

I'm studying for my OCP exam and my book mentions how I should do different things to avoid these dastardly loops that can be cause when an exception handler throws another exception.

Example that does *not* loop infinitely:



DECLARE
  status NUMERIC;
  num NUMERIC;
BEGIN
  DBMS_OUTPUT.put_line('Beginning test...');   num := 1/0; -- throw 1st exception
  DBMS_OUTPUT.put_line('Test successful...'); EXCEPTION
WHEN OTHERS THEN
  BEGIN
    status := SQLCODE;
    num := 2/0; -- throw nested exception   END;
END; Received on Mon May 22 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US