plsql exception

EXCEPTION aligns with BEGIN ... END blocks. There is no BEGIN inside your loop, so there should be no exception either.

It seems the purpose of the exception is to suppress NO_DATA_FOUND errors inside the loop. So to fix this error you need to put a BEGIN / END block in the loop too. (Ah, you have an END just no BEGIN - your code would hurl with the EXCEPTION block).

FOR indx IN 1 .. arr.COUNT
LOOP
    BEGIN 
        SELECT COUNT(*), ca.cities
        INTO tmp_count, affected_cities
        FROM PDB.utilities ca
        ....
    EXCEPTION 
          WHEN NO_DATA_FOUND THEN
             CONTINUE;
    END;  
END LOOP;
posted @ 2019-09-18 17:42  kakaisgood  阅读(239)  评论(0编辑  收藏  举报