Hi All,

I have created one procedure but when compiling it is throwing errors like

HTML Code:
SQL> create or replace PROCEDURE MarkPNATCPL_UPGRADE(
  2   pPredict_group_id IN tms_dict_contents.dict_content_id%TYPE
  3   ,pDict_id          IN tms_dict_contents.def_dictionary_id%TYPE
  4   ,pPN               IN tms_def_levels.def_level_id%TYPE
  5   ,pATC1             IN tms_def_levels.def_level_id%TYPE
  6   ,pATC2             IN tms_def_levels.def_level_id%TYPE
  7   ,pATC3             IN tms_def_levels.def_level_id%TYPE
  8   ,pATC4             IN tms_def_levels.def_level_id%TYPE) IS
  9
 10  CURSOR cuPNs IS
 11    SELECT predict_content_id
 12    FROM   tms_predict_contents
 13    WHERE  def_dictionary_id = pDict_id
 14    AND    def_level_id = pPN;
 15    minus
 16    SELECT dict_content_id                  -- do not consider terms which are set for update or delete
 17    FROM   tms_dict_contents
 18    WHERE  def_dictionary_id = pDict_id
 19    AND    def_level_id      = pPN;
 20
 21   BEGIN
 22
 23     FOR rPNs IN cuPNs LOOP
 24
 25       FOR rRec IN ( SELECT t.* FROM tms_predict_relations t
 26                     WHERE  predict_group_id       = pPredict_group_id
 27                     AND    def_dictionary_id      = pDict_id
 28                     AND    predict_content_ref_id = rPNs.predict_content_id
 29                     AND    def_level_id IN (pATC1,pATC2,pATC3,pATC4)
 30                     AND    dml_statement          <>'D'
 31                     AND    not exists (
 32                       SELECT dict_relation_id FROM tms_dict_relations           -- PreferredName should not have already existing relation with PL
 33                       WHERE  def_dictionary_id    = pDict_id
 34                       AND    dict_content_ref_id  = rPNs.predict_content_id
 35                       AND    prim_link_flag       = opa_user_config.FLAG_YES
 36                       AND    dict_relation_id     <>t.predict_relation_id
 37                          minus                                                  -- And the existing PL relation is not marked for Deletion
 38                       SELECT predict_relation_id FROM tms_predict_relations
 39                       WHERE  predict_group_id     = pPredict_group_id
 40                       AND    def_dictionary_id    = pDict_id
 41                       AND    predict_content_ref_id  = rPNs.predict_content_id
 42                       AND    prim_link_flag       = opa_user_config.FLAG_YES
 43                       AND    predict_relation_id  <>t.predict_relation_id
 44                       AND    dml_statement        <>'D'
 45                     )
 46                     ORDER BY prim_link_flag, def_level_id desc) LOOP
 47                  IF rRec.prim_link_flag = opa_user_config.FLAG_NO THEN
 48                    UPDATE tms_predict_relations SET prim_link_flag = opa_user_config.FLAG_YES
 49                    WHERE predict_relation_id = rRec.predict_relation_id;
 50                    EXIT ;
 51                  ELSE
 52                    EXIT ;
 53                  END IF ;
 54       END LOOP ;
 55
 56     END LOOP ;
 57
 58   END MarkPNATCPL;
 59  /

Warning: Procedure created with compilation errors.

SQL> show err
Errors for PROCEDURE MARKPNATCPL_UPGRADE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
15/3     PLS-00103: Encountered the symbol "MINUS" when expecting one of
         the following:
         begin function pragma procedure subtype type <an identifier>
         <a double-quoted delimited-identifier> current cursor delete
         exists prior

19/33    PLS-00103: Encountered the symbol ";" when expecting one of the
         following:
         . ( * @ % & - + / at for mod remainder rem <an exponent (**)>
         and or group having intersect minus order start union where
         connect || multiset

LINE/COL ERROR
-------- -----------------------------------------------------------------

58/17    PLS-00103: Encountered the symbol "end-of-file" when expecting
         one of the following:
         end not pragma final instantiable order overriding static
         member constructor map

Any help will be appriciated

Thanks
Tp