-1

i have this loop with a procedur, but its run in a error:

ORA-06550: line 18, column 9:
PLS-00103: Encountered the symbol "CELLNEX_HI3GNY2017" when expecting one of the following:

:= . ( @ % ; immediate
The symbol ":=" was substituted for "CELLNEX_HI3GNY2017" to continue.
Error at Line: 7 Column: 0

meaning with this loop is the procedure is dynamically executed, the value v_sidcount is a counter, and the procedure stops when the result in v_sidcount is NULL.

DECLARE
   v_sidcount number;
 --
   v_cid number := 32;
   v_sptid number := 215;
   v_sptid0 number := 32;
   v_sptid1 number := 57;
   v_sptid2 number := 217;
   v_sptid3 number := 218;

BEGIN
    LOOP
SELECT count(sid) into v_sidcount FROM sitetb
WHERE NOT EXISTS (SELECT sid FROM KAM_REPORT_CEL_HI3GNY2017
  WHERE sid = sitetb.sid
) and cid = v_cid and sptid IN (v_sptid0, v_sptid1, v_sptid2, v_sptid3);


EXECUTE CELLNEX_HI3GNY2017();
      IF v_sidcount is NULL THEN 
         exit; 
      END IF;
   END LOOP;
END;

1 Answer 1

1

Remove EXECUTE; procedures are - in PL/SQL - called just by their name (and parameters, if they accept them).

EXECUTE is a SQL*Plus command, which is basically short form of begin-end PL/SQL block.

A few simple examples:

SQL> declare
  2    l_var number;
  3  begin
  4    select count(*) into l_Var from dual;
  5
  6    p_test;
  7  end;
  8  /

PL/SQL procedure successfully completed.

SQL> exec p_test;

PL/SQL procedure successfully completed.

SQL> begin
  2    p_test;
  3  end;
  4  /

PL/SQL procedure successfully completed.

SQL>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.