Hello

   Statement CONTINUE isn't in PL/SQL too, I know it, but Oracle PL/SQL 
has statement GOTO. I don't need GOTO statement, but 'continue' can be 
very usefull for me. I have to do some ugly trick now. With little change, 
we can enhance stmt EXIT for behavior continue.

After some work I can

CREATE OR REPLACE FUNCTION lll() RETURNS void AS $$
DECLARE i integer = 0;
BEGIN
  LOOP
    i = i + 1;
    CONTINUE WHEN i < 10;
    RAISE NOTICE '%', i;
    EXIT;
  END LOOP;
  BEGIN
    CONTINUE WHEN i = 10;
    RAISE NOTICE '---1---';
  END;
  RAISE NOTICE '---2---';
  FOR _i IN 1 .. 10 LOOP
    CONTINUE WHEN _i < 5;
    RAISE NOTICE '%', _i;
  END LOOP;
END; $$ LANGUAGE plpgsql;
select lll();

pokus=# NOTICE:  10
NOTICE:  ---2---
NOTICE:  5
NOTICE:  6
NOTICE:  7
NOTICE:  8
NOTICE:  9
NOTICE:  10
 lll
-----

(1 row)

What do you think about it? It's broke PL/SQL compatibility, I know, but 
via last discussion I have opinion so Oracle compatibility isn't main 
objective PL/pgSQL. There is some less/bigger diferencess: SQLSTATE, 
EXCEPTION from my last proposal, atd.

What do you think about it?

Regards
Pavel Stehule



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to