Oracle pl/sql 中实现 continue

CREATE TABLE AREAS
(
  RADIUS  NUMBER(5),
  AREA    NUMBER(14,2)
);
 
DECLARE
   pi   CONSTANT NUMBER (9, 7)  := 3.1415927;
   radius        INTEGER (5);
   area          NUMBER (14, 2);
BEGIN
   radius := 0;

   LOOP

      <<here>>
      radius := radius + 1;

      IF radius = 4
      THEN
         GOTO here;
      ELSE
         area := pi * POWER (radius, 2);

         INSERT INTO areas
              VALUES (radius, area);

         EXIT WHEN area > 100;
      END IF;
   END LOOP;

   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      ROLLBACK;
      RAISE;
END;
 

你可能感兴趣的:(oracle,sql)