Search code examples
sqloracle-databaseprocedure

PLS00103: encountered the symbol "END"


here is my procedure that is giving me the PLS00130: encountered the symbol "END"error. where is the problem?? am i missing any thing??

CREATE OR REPLACE PROCEDURE GETHEATDATA(HEATNO NUMBER)
IS
BEGIN
  FOR program IN (
    select program_id from rml_program where heat_id=HEATNO
    )
  LOOP
  select
  program.program_id,
    program.job_id,
    program.grade,
    count(t.semiproduct_cnt),
    max(t.charging_date),
    min(t.charging_date),
    max(t.reheating_date),
    min(t.reheating_date),
    count(t.rejecting_date),
    count(t.rolling_date),
    count(t.loss_date)
    from
    rml_semiproduct t
    where
    t.program_id = program.program_id;
  END LOOP;
  END;
  END GETHEATDATA;

Solution

  • 2 things. Firstly, remove the END GETHEATDATA, and secondly, you forgot to join on the program table.