pls-00323: subprogram or cursor "Dec" is declared in the package specification

Hello

How to fix the error below
pls-00323: subprogram or cursor 'Drec' is declared in package specification and must be defined in the package body
in fact, my code is here

Spec
create or replace package x is

  type typ_x277  is record (
  rcncd fin_rcn_grp_mas.rcn_cd%type,
  icode item_master.item_code%type,
  idesc item_master.short_desc%type,
  ob_qty Number,
  rcpt_qty number,
  issue_qty number,
  incr_qty number,
  Rate number,
  incr_value number);
  
  type ref_x277 is ref cursor return typ_x277; 
  
  Procedure drec(x277_rec in out ref_x277,rcncd varchar,fdate date,tdate date);

end x;
body
create or replace package body x is

Procedure drec(x277_rec in out ref_x277,rcncd varchar2,fdate date,tdate date) as
Begin
open x277_rec for 
Select rcn_cd,item_code,short_desc,op,rcpt,issu,incrqty,month_rate,incrqty*month_rate incrvalue
from(
Select rcn_cd,item_code,short_desc,find_item_opening(item_code,fdate) op,rcpt,issu,(find_item_opening(item_code,fdate)+rcpt) - issu incrqty,month_rate
from(
select rcn_cd,a.item_code,short_desc,month_rate,sum(nvl(mrir_qty,0)) Rcpt,sum(nvl(issue_qty,0)) issu
from(
  select item_key,b.rcn_cd,mrir_ccn(a.po_no,a.item_code) as ccn,a.item_code,sum(a.quantity) as mrir_qty, null issue_qty 
    from kar a,fin b
    where trunc(a.document_date,'DD') between fdate and tdate and
          b.rcn_cd=rcncd and
          mrir_ccn(a.po_no,a.item_code)=b.ccn_cd and
          nvl(a.quantity,0) > 0 and
          a.card_code = '50'
    group by item_key,b.rcn_cd,mrir_ccn(a.po_no,a.item_code),a.item_code
    having sum(a.quantity) > 0
union    
     select item_key,b.rcn_cd,a.ccn,a.item_code,null mrir_qty, sum(a.quantity) as issue_qty 
    from kardex a,fin_rcn_grp_mas b
    where trunc(a.document_date,'DD') between fdate and tdate and
          b.rcn_cd=rcncd and
          a.ccn=b.ccn_cd and
          nvl(a.quantity,0) > 0 and
          a.card_code in ('70','71','72')
    group by item_key,b.rcn_cd,a.ccn,a.item_code)a,
item_master b,item_quantity c
where a.item_code = b.item_code
and a.item_key = b.item_key
and a.item_key = c.item_key
and b.item_key = c.item_key
group by rcn_cd,a.item_code,short_desc,month_rate
having sum(nvl(mrir_qty,0)) > 0
order by rcpt desc,a.item_code));
end;


end x277;
my spec is perfectly compiled where the body becomes the error said above.

How to recover this question.

Iqbal

In spec you have this

Procedure gillison (x277_rec in ref_x277, rcncd varchar, date, date of tdate fdate);

In the body, you have this

Procedure gillison (x277_rec in ref_x277, rcncd varchar2, date, date of tdate fdate) as

for rcncd in spec its VARCHAR and the body its VARCHAR2. Change both to VARCHAR2

Tags: Database

Similar Questions

  • PLS-00323: subprogram or cursor...

    Hi all:

    I am getting the error PLS-00323 and don't know why.

    I can compile the original packet header / body without error, but as soon as I change a definition in both places, this error occurs on a line so close to my changes.

    Header of the original packet:
    PROCEDURE clean_temp_data;

    Original Package body:
    PROCEDURE clean_temp_data
    IS

    When I change that, I have error "PLS-00323: subprogram or cursor"CLEAN_TEMP_DATA"is declared in a package specification and must be defined in the package body.

    New package header:
    PROCEDURE clean_temp_data)
    p_Filename IN VARCHAR2,
    p_EbizTranNo in NUMBER);
    New Package body:
    PROCEDURE clean_temp_data)
    p_Filename IN VARCHAR2,
    p_EbizTranNo in NUMBERS)
    IS

    I see no spelling differences, differences of parameter type, header compiles without any problem, but the package body gives me this errror on line 159, which has no connection with this procedure, that procedure does not start until the line of 1513.

    What is the cause and how to fix it? It makes no sense to me.

    Thank you
    Andy

    Hello

    The best way to ensure that you don't make a mistake in the statement is probably to copy the spec' statement in the body. I hope that you did?

    A way possible to reach this error, is that the procedure from far inside the other, as below. This would be the case? -If so, a good idea is always to end-identifiers as I do below.

    SQL> create or replace package pck
      2  as
      3     procedure p1;
      4     procedure p2;
      5     procedure p3;
      6  end pck;
      7  /
    
    Package created.
    
    SQL>
    SQL> create or replace package body pck
      2  as
      3     procedure p1
      4     is
      5        procedure p2
      6        is
      7        begin
      8          null;
      9        end p2;
     10     begin
     11        null;
     12     end p1;
     13
     14     procedure p3
     15     is
     16     begin
     17        null;
     18     end p3;
     19  end pck;
     20  /
    
    Warning: Package Body created with compilation errors.
    
    SQL>
    SQL> show errors
    Errors for PACKAGE BODY PCK:
    
    LINE/COL ERROR
    -------- -------------------------------------------------------------
    4/14     PLS-00323: subprogram or cursor 'P2' is declared in a package
             specification and must be defined in the package body
    
    SQL>
    

    In addition, note the line number it's 4. This is the line number of the specification. If your interpretation

    but the package body gives me this errror on line 159, which has no connection with this procedure, that procedure does not start until the line of 1513.

    seems wrong. The compiler wouldn't know where you would put the body.

    A way to solve your problem must begin with comment on the procedure described in the specification and continue to comment on things until you find your error.

    Concerning
    Peter

  • PLS-00323: subprogram or cursor is declared in a package specification and must be defined in the package body

    Hi all

    Please help me understand why I receive PLS-00323 error when my function exists in the header and body of the package.

    Please find below the source code.

    Maybe I should post more details here, please tell me what else should I show to get help.

    I tried to compile my drawing

    EXEC DBMS_UTILITY.compile_schema (pattern = > 'ZVIT');

    but still

    Select * from user_errors

    Returns

    NAME TYPE SEQUENCE LINE (LINE)

    ------------------------------ ------------ ---------- ---------- ----------

    TEXT

    --------------------------------------------------------------------------------

    ATTRIBUTE MESSAGE_NUMBER

    --------- --------------

    PACKAGE 2 8 12 PKG_PK8842_ACCNOTMOVE BODY

    PLS-00323: subprogram or cursor "ACCNOTMOVEFIZ" is declared in a specific package

    cation and must be defined in the package body

    ERROR 323

    PACKAGE 1 3 12 PKG_PK8842_ACCNOTMOVE BODY

    PLS-00323: subprogram or cursor "ACCNOTMOVEJUR" is declared in a specific package

    cation and must be defined in the package body

    ERROR 323

    2 selected lines.

    source code:

    CREATE OR REPLACE PACKAGE ZVIT. PKG_PK8842_AccNotMove

    AS

    FUNCTION AccNotMoveJUR)

    p_contragentId dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number;

    FUNCTION AccNotMoveFIZ)

    p_contragentId dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number;

    FUNCTION DtLastMove)

    p_Id B2_OLAP. DIMAACCOUNT_ALL.ID%TYPE)

    Date of RETURN;

    END;

    /

    CREATE OR REPLACE PACKAGE BODY ZVIT. PKG_PK8842_AccNotMove

    AS

    FUNCTION AccNotMoveJUR)

    p_contragentId zvit.dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number

    IS

    l_Result Number (1);

    l_contragentId zvit.dwh_CR_contragent.ID%TYPE;

    l_dateopen Date;

    Date of l_dtMove1;

    Date of l_dtMove2;

    BEGIN

    l_Result: = 0;

    BEGIN

    Select Distinct a.contragentid

    In l_contragentId

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and a.ACCOUNTSTATEID not in (1,2);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_contragentId: = NULL;

    END;

    IF l_contragentId IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    Select MAX (a.dateopen)

    In l_DateOpen

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and a.ACCOUNTSTATEID <>2

    and a.DateOpen > p_date;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DateOpen: = NULL;

    END;

    IF l_DateOpen IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and not in Substr (d.accountano, 1, 4) ('2608 ', ' 2658');

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and not in Substr (d.accountano, 1, 4) ('2608 ', ' 2658');

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTAID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.arcdate > = p_date

    and d.ACCOUNTAID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    l_Result: = 1;

    On the other

    l_Result: = 0;

    End If;

    END IF;

    END IF;

    RETURN l_Result;

    END AccNotMoveJUR;

    --------------------------------------------------------------------------------

    FUNCTION AccNotMoveFIZ)

    p_contragentId zvit.dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number

    IS

    l_Result Number (1);

    l_contragentId zvit.dwh_CR_contragent.ID%TYPE;

    l_dateopen Date;

    Date of l_dtMove1;

    BEGIN

    l_Result: = 0;

    BEGIN

    Select Distinct a.contragentid

    In l_contragentId

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and a.ACCOUNTSTATEID not in (1,2);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_contragentId: = NULL;

    END;

    IF l_contragentId IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    Select MAX (a.dateopen)

    In l_DateOpen

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and a.ACCOUNTSTATEID <>2

    and a.DateOpen > p_date;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DateOpen: = NULL;

    END;

    IF l_DateOpen IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr(d.accountano,1,4) <>'2628';

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.arcdate > = p_date

    and d.ACCOUNTBID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr(d.accountano,1,4) <>'2628';

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.ACCOUNTAID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.arcdate > = p_date

    and d.ACCOUNTAID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    l_Result: = 1;

    On the other

    l_Result: = 0;

    End If;

    END IF;

    END IF;

    RETURN l_Result;

    END AccNotMoveFIZ;

    --------------------------------------------------------------------------------

    FUNCTION DtLastMove)

    p_Id B2_OLAP. DIMAACCOUNT_ALL.ID%TYPE)

    Date of RETURN

    IS

    l_Result Date;

    Date of l_DtLast1;

    Date of l_DtLast2;

    Date of l_DtLast3;

    Date of l_DtLast4;

    BEGIN

    l_Result: = NULL;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast1

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTBID = p_Id

    - and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr (d.accountano, 1, 4) not in ('2608', ' 2658 ', ' 2628');

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast1: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast2

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTBID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr (d.accountano, 1, 4) not in ('2608', ' 2658 ', ' 2628');

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast2: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast3

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTAID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast3: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast4

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTAID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast4: = NULL;

    END;

    l_DtLast1:=NVL(l_DtLast1,to_date('01.01.1900','dd.mm.yyyy'));

    l_DtLast2:=NVL(l_DtLast2,to_date('01.01.1900','dd.mm.yyyy'));

    l_DtLast3:=NVL(l_DtLast3,to_date('01.01.1900','dd.mm.yyyy'));

    l_DtLast4:=NVL(l_DtLast4,to_date('01.01.1900','dd.mm.yyyy'));

    l_Result: = Greatest (l_DtLast1, l_DtLast2, l_DtLast3, l_DtLast4);

    IF l_Result = TO_DATE('01.01.1900','dd.mm.yyyy') THEN

    l_Result: = NULL;

    END IF;

    RETURN l_Result;

    END DtLastMove;

    ---////////////////////////////////////////////////////

    END;

    /

    You declare your parameter with a different type between the specification and body, your statements must match.

  • PLS-00225: subprogram or cursor reference off scoper - error

    I have a call to an another procedureB proceedings. This procedure within a package of packageB.I have an IF condition (inside A procedure) to search for a value of variable 'v_errmsg' inside ProcedureB. The v_errmsg is declared inside the ProcedureB as below.
    v_errmsg VARcHAR2(1000) := c_procname 
    where c_procname is declared in the body of PackageB as
    c_procname CONSTANT VARCHAR2(32) := 'pr_InitializeGlobalVariables';
    My code looks like this
    IF packageB.ProcedureB.v_errmsg is null then
    ...do something
    else
    ... do something else
    end if;
    This gives an error PLS-00225: subprogram or cursor reference ProcedureB is out of reach.

    Any suggestions on how the call to the variable should be appreciated?

    Published by: steve2312 on January 13, 2012 09:01

    Hello

    steve2312 wrote:
    I have a call to an another procedureB proceedings. This procedure within a package of packageB.I have an IF condition (inside A procedure) to search for a value of variable 'v_errmsg' inside ProcedureB. The v_errmsg is declared inside the ProcedureB as below.

    v_errmsg VARcHAR2(1000) := c_procname 
    

    ... My code looks like this

    IF packageB.ProcedureB.v_errmsg is null then
    ...do something
    else
    ... do something else
    end if;
    

    If v_errmsg is either inside the ProcedureB, it can be referenced only within ProcedureB. If you need to refer to the variable outside of the procedure, then

    • Declare it in the packageB specification (not in ProcedureB), or
    • make an OUT argument, or
    • change the procedure to a function if the function may return to v_errmsg, or
    • Save it in a variable SYS_CONTEXT or a global temporary table.

    If v_errmsg is declared in the packageB specification, so you can reference it like this:

    IF  packageB.v_errmsg  IS NULL  THEN
    

    I hope that answers your question.
    If this is not the case, after a Complete test script that people can work to recreate the problem and test their ideas. Include complete reports for CREATING a PACKAGE and CREATE PACKAGE BODY and little code to call the procedure, or refer to the variable, or whatever it is you want to do.
    Also post the result desired from this code. Offers call dbms_output.put_line (or something) to show results.
    Always tell what version of Oracle you are using.

    Published by: Frank Kulash, January 13, 2012 12:19

  • What is the difference between the function declared in the package and the CIP

    What is the difference between the definition of a function in the package and package body?

    Published by: user10641405 on November 19, 2009 13:29

    If you describe a package, you will see only the functions declared in the spec.
    If you declare only in the body but are not available to other packages (they are private to the package, non-public)

  • Error PLS-00323

    Hi, I have this request, but when I execute this part of the code: create or replace package vista_cupones_PKG body, I get this error:


    PLS-00323: subprogram or cursor "rango" is declared in one specification package and must be defined in the package body

    create or replace package vista_cupones_PKG as

    Rango procedure (desde date, hasta date);

    function obtener_desde

    return the date;

    function obtener_hasta

    return the date;

    end vista_cupones_PKG;

    /

    create or replace package body vista_cupones_PKG as

    procedure Rango (P_desde, the P_hasta date) as

    Start

    obt_desde_fecha: = P_desde;

    obt_hasta_fecha: = P_hasta;

    end;

    function obtener_desde

    the date is back

    Start

    date obt_desde_fecha;

    Return obt_desde_fecha;

    end;

    function obtener_hasta

    the date is back

    Start

    date obt_hasta_fecha;

    Return obt_hasta_fecha;

    end;

    end vista_cupones_PKG;

    /

    Create view vista_cupones as

    SELECT

    Cast (QPCASH. TICKET. VAL_NUM as varchar (18)) in the TICKET.

    QPCASH. TICKET. TCK_MNT/100 as MONTO,

    QPCASH. TICKET. CREDAT as DATE,

    GALAXIS. BCLIENT.ID_CLI as ID_CLIENTE,

    GALAXIS. BCLIENT. FIRST NAME | ' ' || GALAXIS. BCLIENT. NAME in the NUMBER,

    SITE2. FCONSOM. COD_UTILIS as REGISTRO,

    QPCASH. TCKSTS. LIB_STS as ESTADO,

    GALAXIS. FTYPCLI. LIB_LONG2 as CATEGORIA

    Of

    GALAXIS. BCLIENT,

    SITE2. FCONSOM,

    QPCASH. TCKSTS@LNK_Galaxis_QPSal,

    GALAXIS. FTYPCLI,

    QPCASH. TCKTYP@LNK_Galaxis_QPSal,

    QPCASH. QPCONSTCK@LNK_Galaxis_QPSal,

    QPCASH. TICKET@LNK_Galaxis_QPSal

    WHERE

    (QPCASH. TCKSTS.ID_STS = QPCASH. TICKET.ID_STS)

    AND (QPCASH. TCKTYP.ID_TCKTYP = QPCASH. TICKET.ID_TCKTYP)

    AND (QPCASH. QPCONSTCK.ID_TCK (+) = cast (QPCASH. TICKET. VAL_NUM as varchar (18)))

    AND (SITE2. FCONSOM.ID_CONSO (+) IS QPCASH. QPCONSTCK.ID_CONSO)

    AND (GALAXIS. BCLIENT.ID_CLI (+) IS SITE2. FCONSOM.ID_CLI)

    AND (GALAXIS. BCLIENT. COD_TYPCLI = GALAXIS. FTYPCLI. COD_TYPCLI)

    AND (QPCASH. TICKET. CREDAT between vista_cupones_PKG.obtener_desde and vista_cupones_PKG.obtener_hasta

    AND QPCASH. TCKTYP. LIB_TCKTYP = 'PROMOTIONAL LIMITED');

    What could be the problem? Thank you!!!

    Hello

    You must use the same variable name for procedure rango in specificatino package and package body:

    create or replace package vista_cupones_PKG as

    Rango procedure (desde date, hasta date);

    create or replace package body vista_cupones_PKG as

    procedure Rango (P_desde , the P_hasta date) as

    Start

    obt_desde_fecha: = P_desde;

    obt_hasta_fecha: = P_hasta;

    end;

    FIX:

    create or replace package vista_cupones_PKG as

    Rango procedure (desde date, hasta date);

    create or replace package body vista_cupones_PKG as

    procedure Rango (desde in date, hasta date) as

    Start

    obt_desde_fecha: = desde;

    obt_hasta_fecha: = hasta;

    end;

  • PL/SQL: ORA-00904 invalid identifier, PLS-00225: reference of the subprogram or cursor is out of reach

    Hi gurus,

    Your help is greatly appreciated.

    Will I have a fucntion where we have the object it contains.

    The changes that I have doen are: 2 new cusrosrs, but its failure with the error below.

    Highlighted are the changes I made. his length very well before your help is greatly appreciated.

    1) PL/SQL: ORA-00904: "GET_ACQ_ID.". ' ACQ_ID ': invalid identifier.

    (2) PLS-00225: subprogram or cursor reference 'GET_ACQ_ID' is out of range

    Here is the code:

    _________________________________________________________________________

    FUNCTION GET_IP_COMM_INFO return PROD. TERMINAL_IP_COMM_INFO_TAB IS

    vTer TER.ter_id%TYPE;
    vAPPL_ID TAC.appl_id%TYPE;
    vValue TSF.vALUE%TYPE;

    IP_COMM_INFO_LIST PROD. TERMINAL_IP_COMM_INFO_TAB: = PROD. TERMINAL_IP_COMM_INFO_TAB();

    CURSOR GET_ACQ_ID IS
    SELECT ACQ_ID
    TER TAHA, MERC M, PROF
    WHERE T.MER_ID = M.MER_ID
    AND M.PROFID = P.PROF_ID
    AND T.TER_ID = vTer_id;


    CURSOR GET_INFO_CURSOR IS
    SELECT H.DESCRIPTION AS HOST_DESCRIPTION
    PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI
    WHERE (AICAI. HOST_ID = H.HOST_ID) and
    (AICAI. APPL_ID = vAPPL_ID);

    CURSOR GET_ACQ_CURSOR IS
    SELECT H.DESCRIPTION AS HOST_DESCRIPTION
    PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI, PROD. ACQUIRER_IP_COMM_ACCESS_INFO ACICAI
    WHERE (AICAI. HOST_ID = H.HOST_ID) and
    (AICAI. APPL_ID = vAPPL_ID) AND
    (ACQUIRER_ID = GET_ACQ_ID. ACQ_ID);
    BEGIN

    vTer_id: = GLOBAL_VARIABLES.gv_ref_Ter_id;

    BEGIN
    SELECT the VALUE IN vvalue OF Tsf
    WHERE TER_id = vTEr_ID AND APPL_ID is vAPPL_ID and FEATURE_ID = 861;.

    Vvalue = '04' IF THEN
    For GET_ACQ_REC IN GET_ACQ_CURSOR
    LOOP
    IP_COMM_INFO_LIST. EXTEND;
    IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);
    END LOOP;
    ON THE OTHER
    FOR GET_INFO_REC IN GET_INFO_CURSOR
    LOOP
    IP_COMM_INFO_LIST. EXTEND;
    IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_INFO_REC. HOST_DESCRIPTION);
    END LOOP;
    END IF;

    RETURN IP_COMM_INFO_LIST;
    EXCEPTION WHEN OTHERS THEN
    LIFT;
    END GET_IP_COMM_INFO;

    ----------------------------------------------------------

    You try to access another variable of slider within the slider...

    CURSOR GET_ACQ_CURSOR IS

    SELECT H.DESCRIPTION AS HOST_DESCRIPTION

    PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI, PROD. ACQUIRER_IP_COMM_ACCESS_INFO ACICAI

    WHERE (AICAI. HOST_ID = H.HOST_ID) and

    (AICAI. APPL_ID = vAPPL_ID) AND

    (ACQUIRER_ID = GET_ACQ_ID. ACQ_ID );

    But you have not opened this slider, or anything like that.

    You will probably need to pass as a parameter, just like a function:

    (not sure of the type of data, so I assumed that the NUMBER)

    CURSOR GET_ACQ_CURSOR (NUMBER in_acq_id) IS

    SELECT H.DESCRIPTION AS HOST_DESCRIPTION

    PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI, PROD. ACQUIRER_IP_COMM_ACCESS_INFO ACICAI

    WHERE (AICAI. HOST_ID = H.HOST_ID) and

    (AICAI. APPL_ID = vAPPL_ID) AND

    (ACQUIRER_ID = in_acq_id );

    When you call this type, you must pass a value... So, it seems that you first call the other cursor.

    Change this code:

    IF Vvalue = ' 04 "THEN

    FOR GET_ACQ_REC IN GET_ACQ_CURSOR

    LOOP

    IP_COMM_INFO_LIST. EXTEND;

    IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);

    END LOOP;

    ON THE OTHER

    To do this:

    IF Vvalue = ' 04 "THEN

    FOR GET_ACQ_ID_REC IN GET_ACQ_ID IS

    LOOP

    FOR GET_ACQ_REC IN GET_ACQ_CURSOR (get_acq_id_rec.acq_id)

    LOOP

    IP_COMM_INFO_LIST. EXTEND;

    IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);

    END LOOP;

    END LOOP;

    ON THE OTHER

    (Or something like that)

    I wasn't sure if your GET_ACQ_ID cursor returns only 1 row or not? If it returns more than 1 row, how to cope, you do not specify.

    If it's just 1 row, then you can probably simplify it a little more:

    IF Vvalue = ' 04 "THEN

    SELECT ACQ_ID

    in l_acq_id

    TER TAHA, MERC M, PROF

    WHERE T.MER_ID = M.MER_ID

    AND M.PROFID = P.PROF_ID

    AND T.TER_ID = vTer_id;

    FOR GET_ACQ_REC IN GET_ACQ_CURSOR (l_acq_id)

    LOOP

    IP_COMM_INFO_LIST. EXTEND;

    IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);

    END LOOP;

    ON THE OTHER

    Hope that helps.

  • subprogram or cursor reference 'CUR_FEATURE' is out of range

    Hi gurus,

    Your help is greatly needed. I am trying to compile this function and get the below error.

    Trying to set the code, could you please season here.

    PL/SQL: Statement ignored

    PLS-00225: subprogram or cursor reference 'CUR_FEATURE' is out of range

    FUNCTION GET_TERMINAL_FEATURE_TYPE RETURN PROD. FEATURE_CUSTOM_LIST_TAB
    IS

    vTerminal_Id PROD. TERMINAL SERVER. TYPE % TERMINAL_ID;
    vCFTSELECT PROD. CUSTOM_FEATURE_TYPE. TYPE % FEATURE_TYPE_SELECT;
    nPRECEDENCE PROD. CUSTOM_FEATURE_TYPE. PRIORITY % TYPE;
    nWIRE_COMM_SEQ_ID PROD. WIRELESS_COMM_INFO. TYPE % WIRELESS_COMM_SEQ_ID;
    vDESC PROD. WIRELESS_COMM_INFO. DESCRIPTION % TYPE;
    nFEATURE_TYPE_ID PROD. FEATURE_TYPE. TYPE % FEATURE_TYPE_ID;

    TYPE CFT_SEL_REF_CUR IS REF CURSOR;
    CFT_SEL_CUR CFT_SEL_REF_CUR;

    CUSTOM_FEATURE_TYPE_LIST PROD. FEATURE_CUSTOM_LIST_TAB: = PROD. FEATURE_CUSTOM_LIST_TAB();


    CURSOR CUR_FEATURE (cvTERMINAL_ID PROD. TERMINAL SERVER. TERMINAL_ID % TYPE) IS
    SELECT THE TSF. TERMINAL_FEATURE_ID, TF. FEATURE_TYPE_ID, FEATURE_SEQUENCE_ID ROWNUM
    PROD. TERMINAL_FEATURE TF, PROD. TSF TERMINAL_SPEC_FEATURE
    WHERE TF. TERMINAL_FEATURE_ID = TSF. TERMINAL_FEATURE_ID
    AND TSF. TERMINAL_ID = cvTERMINAL_ID
    ORDER BY TSF. TERMINAL_FEATURE_ID;

    CURSOR CUR_FEATURE_TYPE (cvFETAURE_TYPE_ID PROD. FEATURE_TYPE. FEATURE_TYPE_ID % TYPE) IS
    SELECT FEATURE_TYPE_ID, FEATURE_SEQUENCE_ID, DISPLAY_VALUE, DATA_VALUE
    OF FEATURE_TYPE
    WHERE FEATURE_TYPE_ID = cvFETAURE_TYPE_ID
    ORDER BY FEATURE_SEQUENCE_ID;



    BEGIN
    DBMS_OUTPUT. Put_line ("inside the function GET_TERMINAL_FEATURE_TYPE");
    vTerminal_id: = PROD. TMS_GLOBAL_VARIABLES.gv_ref_Terminal_id;

    IF CUR_FEATURE. FEATURE_TYPE_ID > = 1000 THEN

    -Make feature_type_id and feature_id for Terminal
    FOR CUR_FEATURE_REC IN CUR_FEATURE (vTerminal_id)
    LOOP
    -Get the select query based on feature_type_id
    SELECT FEATURE_TYPE_SELECT FROM vCFTSELECT
    PROD. CUSTOM_FEATURE_TYPE
    WHERE FEATURE_TYPE_ID = CUR_FEATURE_REC. FEATURE_TYPE_ID;

    CFT_SEL_CUR OPEN for vCFTSELECT USING vTerminal_id;
    LOOP
    Search FOR CFT_SEL_CUR IN nWIRE_COMM_SEQ_ID, vDESC;
    WHEN THE OUTPUT CFT_SEL_CUR % NOTFOUND;

    CUSTOM_FEATURE_TYPE_LIST. EXTEND;
    CUSTOM_FEATURE_TYPE_LIST (CUSTOM_FEATURE_TYPE_LIST. COUNTY)
    : = FEATURE_CUSTOM_LIST_OBJ (vTerminal_id,
    CUR_FEATURE_REC. TERMINAL_FEATURE_ID,
    CUR_FEATURE_REC. FEATURE_SEQUENCE_ID,
    vDESC,
    nWIRE_COMM_SEQ_ID
    );
    END LOOP;
    CLOSE CFT_SEL_CUR;

    END LOOP;

    ON THE OTHER
    FOR CUR_FEATURE_TYPE_REC IN CUR_FEATURE_TYPE (cvFETAURE_TYPE_ID)
    LOOP

    CUSTOM_FEATURE_TYPE_LIST. EXTEND;
    CUSTOM_FEATURE_TYPE_LIST (CUSTOM_FEATURE_TYPE_LIST. COUNTY)
    : = FEATURE_CUSTOM_LIST_OBJ (vTerminal_id,
    CUR_FEATURE_TYPE_REC. FEATURE_TYPE_ID,
    CUR_FEATURE_TYPE_REC. FEATURE_SEQUENCE_ID,
    CUR_FEATURE_TYPE_REC. DISPLAY_VALUE,
    CUR_FEATURE_TYPE_REC. DATA_VALUE
    );
    END LOOP;
    END IF;

    RETURN CUSTOM_FEATURE_TYPE_LIST;

    EXCEPTION WHEN OTHERS THEN
    Lift;
    END GET_TERMINAL_FEATURE_TYPE;

    Hello

    The problem may be with this line

    IF CUR_FEATURE. FEATURE_TYPE_ID > = 1000 THEN

    You cannot reference columns of a cursor; you reference the columns of an instance of the slider.  For example, inside the loop that begins

    FOR CUR_FEATURE_REC IN CUR_FEATURE (vTerminal_id)

    LOOP

    It is valid to say

    IF CUR_FEATURE_REC. FEATURE_TYPE_ID > = 1000 THEN

    However, until you open an instance of the slider, he extracted all data (for example, FEATURE_TYPE_ID), therefore impossible to refer to the instance or its columns.

    What exactly are you trying to do?

  • Cursor of return of (nested) function - PLS-00201: identifier of the CURSOR must be declared

    Hello

    I have a function in which I use nested functions (because I don't want to create objects explicit / external, it is a requirement that I don't have any effect on / I don't want to change).

    In my external function, I use cursor by declaring them in IS-section and then open using the loop for instruction.

    In my inner function / nested, I also want to use a cursor.

    There I also said one like I did in an external function within the section IS of the nested function.

    SQL Developer complains about syntax error (';: wait ").

    When you try to compile the whole process I get the following error:

    "Error (97,14): PLS-00201: identifier 'CURSOR' must be declared '.

    It's my external function starts as:

    CREATE OR REPLACE FUNCTION FN_GENERATE_QUERY_PMT (instance_id_in IN NUMBER, language_in IN VARCHAR2)
    RETURN CLOB
    IS
         CURSOR c_outer IS
          SELECT * FROM BLA;
    

    When it comes to my internal function with the section IS of the external function and stands (inner functions should be at the end of the Section IS to stand behind the statements of variable and cursor, otherwise there will be an error):

    FUNCTION nfn_get_value (num_in IN NUMBER)
          RETURN SYS_REFCURSOR
        IS
          SYS_REFCURSOR c_inner IS
          SELECT *
          FROM BLUB;
        BEGIN
          RETURN c_where_in;
        END;
    

    After that there will be another nested function, then the BEGIN section will appear.

    When looking for 'function returns cursor' I can only find solutions where the cursor is declared in section IS (sometimes its an AS-section o_O * worried *) but wihtoug select, just declare type.

    The cursor focus is added in the Begin block to the way open for instruction. But I don't want to open it yet. I want to open the cursor using the loop statement. I am able to reopen? used can it be two sliders while one will not be closed properly?

    How to fix to return a cursor that I can use in my external function.

    Advice would be appreciated.

    Thanks in advance.

    Maybe I got the soultion
    First of all, I found this thread:

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:5241391331097

    said the following:

    2) a ref cursor is just a cursor.  a ref cursor is just a cursor.  a ref cursor is just a cursor.... (keep saying it over and over
    

    But fortuneately I also found this post:
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:14188501024541

    where thankfully someone shared her knowledge with others:

    In view of this block of code - you may see more "prominent" unlike - any

    How many times you run this block - cursor C will always be select * twice.  The ref

    cursor is not guaranteed.

    Another difference is that a ref cursor can be returned to a client.  a plsql 'cursor cursor.

    cannot be returned to a client.

    Another difference is a cursor can be global - a ref cursor cannot (you cannot set

    them outside a procedure / function)

    Another difference is a ref cursor can be passed to the subroutine - a subroutine

    cursor cannot be.

    This explains why the samples seem always fair with open (Ref) cursor within the section to START.

    I expeceted this (as I wrote in the first post) and ask if the course of opening will be sent back twice or just redirect. I suppose it it reassigns who were just a little in performance.

    But I can't yet find this good explanation of this type anywhere within the documentation and of course I didn't read it all. Shame on me, but I'm always engaged by internet download.

    I would be grateful if someone could say my last statement and leave a comment on double-distribution of the refcursors has reopened.

    Thanks in advance.

  • Iterating through a collection of cursor type give PLS-00306: wrong number or types of arguments in the call to "PUT_LINE '.

    I wrote the following anonymous block. He has a slider ""cur_total_tckt "who choose 6 columns."  A nested table 'total_tckt_colcn' is declared of type ""cur_total_tckt "."  In the dbms_output.put_line I want to print each item in my collection. It gives me the following error:

    PLS-00306: wrong number or types of arguments in the call to "PUT_LINE '.

    ORA-06550: line 29, column 2:

    PL/SQL: Statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    I want to print all 6 columns of an element for 366 these elements.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    DECLARE
    CURSOR cur_total_tckt    
      is
      select t.ticket_id ticket_id, t.created_date created_date, t.created_by created_by, t.ticket_status ticket_status,
      t.last_changed last_changed, h.created_date closed_date
      from n01.cc_ticket_info t
      inner join n01.cc_ticket_status_history h
      on (t.ticket_id = h.ticket_id)
      where t.last_changed >= '6/28/2012 17:28:59' and t.last_changed < (sysdate + interval '1' day);

    type total_tckt_colcn
    is
      TABLE OF cur_total_tckt%rowtype;
      total_tckt_col total_tckt_colcn;
      total_coach_col total_tckt_colcn;
    begin
    total_tckt_col := total_tckt_colcn ();
    total_coach_col := total_tckt_colcn ();
      OPEN cur_total_tckt;
      loop
      fetch cur_total_tckt bulk collect into total_tckt_col limit 100;

      dbms_output.put_line(total_tckt_col.last);

      FOR i IN total_tckt_col.first..total_tckt_col.last
      loop

      -- dbms_output.put_line(total_tckt_col(i).ticket_id);          -- this line works
      dbms_output.put_line(total_tckt_col(i));                       -- this line gives error

      END LOOP;

      exit
      WHEN (cur_total_tckt%NOTFOUND);

      END LOOP ;
      CLOSE cur_total_tckt; 




    end;

    making reference to an element differs from the reference to a field in the record that is part of the collection.

    'dbms_output.put_line (total_tckt_col (i))' works if there is only a single element.

    will not work if this element has subcomponents. in your case it has subcomponents as fields in a record.

  • PLS-00320 - the declaration of the type of the expression is incomplete or

    Hello

    Please help me get rid of this error?
    PLS-00320 - the declaration of the type of the expression is incomplete or incorrect
    PROCEDURE wip_reversal_proc
                    ( p_packing_id   IN  packing.packing_id%TYPE,
                      o_return_msg   OUT VARCHAR2 )
    IS
     CURSOR c_packing
      IS
         SELECT    p.client
                  ,p.order_number
                  ,pa.dc
                  ,p.status          
                  ,o.status
                  ,o.bo_child_order_id
           FROM    packing p      
                  ,packing_attributes pa
                  ,orders o             
          WHERE   p.packing_id      = p_packing_id
              AND   pa.packing_id      = p.packing_id
              AND   o.client           = p.client
              AND   o.order_number = p.order_number;
    
    
    ------------------------------------------------------------------
      -----------------------------MAIN---------------------------------
      ------------------------------------------------------------------
    BEGIN
      pack_rec                  c_packing%ROWTYPE;
      
       OPEN c_packing;
         FETCH c_packing 
          INTO  pack_rec;     
      
       v_lock               := TRUE;
       invrec.client       := pack_rec.client;

    Try this,

    Procedure wip_reversal_proc( p_packing_id IN  packing.packing_id%Type
                               , o_return_msg OUT Varchar2 ) Is
       Cursor c_packing Is
          SELECT p.client
               , p.order_number
               , pa.dc
               , p.status
               , o.status
               , o.bo_child_order_id
            FROM packing            p
               , packing_attributes pa
               , orders             o
           WHERE p.packing_id = p_packing_id
             AND pa.packing_id = p.packing_id
             AND o.client = p.client
             AND o.order_number = p.order_number;
    
       pack_rec c_packing%Rowtype;
    Begin
       Open c_packing;
       Loop
          Fetch c_packing
             INTO pack_rec;
          Exit When c_packing%Notfound;
          v_lock        := True;
          invrec.client := pack_rec.client;
       End Loop;
       Close c_packing;
    End;
    

    Kind regards
    Christian Balz

  • PLS-00320: the declaration of the type of this expression is (incomplete)

    It is a procedure that I created in order to read and write to a directory. I get this error messages I'm not what I'm you hurt here can help me.
    error messages include
    1. the declaration of the type of the expression is incomplete e
    2 PLS-00201: identifier 'FTP.T_STRING_TABLE' must be declared.
    3.pls - 00201: identifier 'FTP.LOGIN' must be declared
    4 PLS-00201: identifier 'FTP.LOGOUT' must be declared.

    PROCEDURE SP_TESTOMG_SIG
    AS

    l_conn UTL_TCP.connection;
    l_list ftp.t_string_table;
    BEGIN
    l_conn: = ftp.login ('172.20.100.240', '21', 'ftpuser', 'ftppassword');
    ftp.LIST (p_conn = > l_conn p_dir = > ' / xch/signatures ', p_list = > l_list);
    ftp.LOGOUT (l_conn);

    IF l_list. COUNT > 0
    THEN
    BECAUSE me IN l_list. FIRST... l_list. LAST
    LOOP
    Dbms_output.put_line (I |) ': ' || l_list (i));
    END LOOP;
    END IF;
    END;

    Published by: kama021 on June 10, 2009 01:37

    you do not have access to a package named FTP..., that's what it means.

  • Remove the statement that uses a subselect in the declaration of the cursor

    Hi all

    How to write write a delete statement that uses a subselect with the declaration of the cursor?

    CURSOR excluded_dates IS          
           SELECT TO_TIMESTAMP(report_parameter_value, in_date_format_mask)
          INTO my_current_date_time
          FROM report_parameters
         WHERE report_parameters.report_parameter_id    = in_report_parameter_id
           AND report_parameters.report_parameter_group = 'DATE_TIME'
           AND report_parameters.report_parameter_name  = 'EXCLUDED_DATE';
     OPEN excluded_dates;
      
      LOOP
        
        FETCH excluded_dates INTO my_excluded_date;
        
        EXIT WHEN excluded_dates%NOTFOUND;
        
        DELETE FROM edr_rpt_tmp_inclusion_table
        WHERE TO_CHAR(date_time, 'mm/dd/yyyy') = TO_CHAR(my_excluded_date, 'mm/dd/yyyy');
        
      END LOOP;
    
      CLOSE excluded_dates;
    Thank you

    Hello

    You can turn your cursor into a subquery IN

    DELETE FROM edr_rpt_tmp_inclusion_table
    WHERE   TRUNC (date_time) IN
    (
           SELECT TRUNC (TO_TIMESTAMP(report_parameter_value, in_date_format_mask))
    --      INTO my_current_date_time   -- Remove this line
          FROM report_parameters
         WHERE report_parameters.report_parameter_id    = in_report_parameter_id
           AND report_parameters.report_parameter_group = 'DATE_TIME'
           AND report_parameters.report_parameter_name  = 'EXCLUDED_DATE'
    );
    

    I used the TRUNK instead of TO_CHAR, but it works with TO_CHAR.

    Published by: Frank Kulash, June 8, 2009 11:28
    Remove the "my_current_date_time" line, after Sean and Sanjay (below).

  • ORA-06550, PLS-00306: wrong number or types of arguments in the call to ' |'

    Hi all

    Please help me about this error, if I comment the threshold (in the color of the thickness)

    ERROR on line 19:

    ORA-06550: line 19, column 25:

    PLS-00306: wrong number or types of arguments in the call to ' |'

    ORA-06550: line 19, column 3:

    PL/SQL: Statement ignored

    DECLARE

        TYPE nametable IS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;

        vname NAMETABLE

        CURSOR cf

        IS

          SELECT ename

            FROM emp;

        i     NUMBER;

    START

        OPEN cf;

        i := 1;

        LOOP

            FETCH cf INTO Vname (i);

            EXIT WHEN cf%NOTFOUND;

            i := i + 1;

        END LOOP;

        CLOSE cf;

    dbms_output. Put_line ('Name is ' || VNAME );

        FOR n IN 1.. VNAME . County LOOP

    dbms_output. Put_line ('Name is ' || VNAME (n));

        END LOOP;

    END ;


    Thank you

    VNAME is an associative array. You can not use in DBMS_OUTPUT. Put_line as such. You need to loop through what you did in the code after the DBMS_OUTPUT and print each element of the array individually.

  • PLS-00306: wrong number or types of arguments in the call to PUT_LINE

    Hi all

    I m new to the pl sql, when I run the below block I get errors.

    kindly help me on this.

    DECLARE

    Siva ARRAY TYPE IS VARCHAR2 (100);

    s siva;

    Cur_i IS SELECT name FROM employee of CURSOR;

    BEGIN

    OPEN cur_i.

    LOOP

    SEEK cur_i s INTO;

    EXIT WHEN cur_i % NOTFOUND;

    DBMS_OUTPUT. Put_line (s);

    END LOOP;

    CLOSE Cur_i;

    END;


    I m getting the error below:

    PLS-00597: expression' in the INTO list has the wrong type

    PLS-00306: wrong number or types of arguments in the call to "PUT_LINE '.



    Hello

    I think that you are learning/exercises PL/SQL. See below the approach.

    declare

    siva type is table of the varchar2 (100);

    s siva;

    cursor cur_i is
    Select first_name from employees;

    Start

    Open cur_i;

    loop
    collect fetch cur_i in bulk
    s;
    When the output cur_i % notfound;
    end loop;

    close cur_i;

    -Printing values in the collection

    because me s.first... loop of s.Last
    dbms_output.put_line (s (i));
    end loop;

    end;

    Thank you

    Suri

    Post edited by: Suri

    Simple loop removed and exit when collecting conditions because we fetch all the records of a sudden in the collection using the bulk.

Maybe you are looking for