Parsing error PL/SQL

We are using PL/SQL as coding language. For most of our code smells we get a parsing error message. My question is, why do i even get this message? For me everything seems fine for the begin/end block. Also the “Why is this an issue” message doesnt really help… Could you please help me with this?


Hi,

The issue you’re showing is telling you essentially that the file wasn’t analyzed because SonarQube couldn’t parse it. Could you provide a minimal reproducer of a parsing error?

Also, what version of SonarQube are you on?

 
Ann

-- @(#) (c) inconso AG, Bad Nauheim
-- $Author: btt $
-- $Date: 2018/11/29 13:05:59 $
-- $Revision: 1.1.2.1 $
-- $Source: /blgblg/rep/source/amp/anlagen/pkg_amp_anl_batch/Attic/upd_batch_pm_aufgebaut.sql,v $
-------------------------------------------------------------------------------
-- IN    :
-- OUT   :
-- TYP   :
-- DOING : Bildung einer PHI-interner Batch basierend auf dem PP-Plan   
-------------------------------------------------------------------------------
procedure upd_batch_pm_aufgebaut(p_lager            in amp_anl_batch.lager%type
                                ,p_id_batch         in amp_anl_batch.id_batch%type
                                ,p_knz_pm_aufgebaut in amp_anl_batch.knz_pm_aufgebaut%type
                                ,p_opid             in varchar2
                                ,p_trace            in number) 
is
   IDENT('pkg_amp_anl_batch.upd_batch_pm_aufgebaut',
         '$Revision: 1.1.2.1 $',
         '$Date:');
   trace                      number;
   sub_trace                  number;
   
begin
trace           := greatest(p_trace,g_trace,nvl(pkg_switches.get_tracelevel_no_detect,0));
   sub_trace       := greatest(trace - 3, 0);
   
   -------------------------------------------------------
   -- Eingangstracing
   -------------------------------------------------------
   TRACE(3, 'ENTRY: '||ident);
   TRACE(4, 'in  lager            : <' || p_lager            || '>');
   TRACE(4, 'in  id_batch         : <' || p_id_batch         || '>');
   TRACE(4, 'in  knz_pm_aufgebaut : <' || p_knz_pm_aufgebaut || '>');
   TRACE(4, 'in  trace            : <' || p_trace            || '>'); 
   
   update amp_anl_batch b
      set b.knz_pm_aufgebaut = p_knz_pm_aufgebaut
         ,b.knz_pm_bereitstell  = case
                                     when p_knz_pm_aufgebaut = '0' then '0'
                                     else                                b.knz_pm_bereitstell
                                  end 
         ,b.time_aen         = sysdate
         ,b.opid_aen         = p_opid
    where b.lager            = p_lager
      and b.id_batch         = p_id_batch;
   if sql%rowcount = 0 then
      if (trace >= 9) then xlog('###-00000', ' no record updated ', uname); end if;
   end if;   
   
   -------------------------------------------------------
   -- Ausgangstracing
   -------------------------------------------------------  
   TRACE(3, 'NORMAL EXIT:  '||ident);
  
exception
   WHEN_OTHERS;
end;
-------------------------------------------------------------------------------

We are using * Enterprise Edition* Version 8.7.1

Thanks!

This will be very helpful for the language experts when they show up.

 
:slightly_smiling_face:
Ann

Hi.

The exception handler isn’t a valid PL/SQL code. I’m pretty sure that this code doesn’t compile correctly on a Oracle database.

It should be:

exception
   when others then
      null; -- or some other code here
end;
2 Likes