4 Replies Latest reply: Dec 28, 2016 6:57 AM by Fernando Damas Wenzel RSS

    Error when trying to execute a procedure (in Qlik Sense)

    Fernando Damas Wenzel

      Hi everyone,

       

      I've been trying to execute a procedure, but with no success.

      Even though i tried to follow all topics here in qcommunity, no one gave me insights to find a solution.

       

      This is the error I am receiving:

      ERROR.png

       

      And here is the just a beggining part of this procedure. I am posting it here because i have no SQL skills at all and might be missing something.

      :

       

      CREATE OR REPLACE PROCEDURE CUSTOM.pd_resultados (pAMI IN varchar2, pAMF IN varchar2, resultcursor IN OUT rcr.pkTipos.resultcursor_Type)

      IS

       

       

      vDataI date;

      vDataF date;

      IndCursor integer;

      sSQL    Long;

      sSQL1   Long;

      sSQL2   Long;

      sSQL3   Long;

      vcDataI varchar2(10);

      vcDataF varchar2(10);

       

      BEGIN

       

       

      vDataI := to_date(pAMI||'-01','yyyy-mm-dd');

      if substr(pAMF,6,2) = '12'

      then vDataF := to_date('01-01-'||to_char(to_number(substr(pAMF,1,4))+1),'dd-mm-yyyy');

      elsif substr(pAMF,6,2) < '09'

         then vDataF := to_date('01-0'||to_char(to_number(substr(pAMF,6,2))+1)||'-'||substr(pAMF,1,4),'dd-mm-yyyy');

         else vDataF := to_date('01-'||to_char(to_number(substr(pAMF,6,2))+1)||'-'||substr(pAMF,1,4),'dd-mm-yyyy');

      end if;

       

       

      vcDataI := to_char(vDataI,'dd-mm-yyyy');

      vcDataF := to_char(vDataF,'dd-mm-yyyy');

      sSQL :=

      (begin creating tables)