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

Tags: Database

Similar Questions

  • 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-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

  • 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

  • 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?

  • PLS-00231 - function cannot be used in SQL

    Morning you all,.

    Please, don't ask me not to do this kind of function, because I cut the pieces that are not important information to my question. Thank you.

    Package:

    function PL_Fun)

    P_COD1 IN VARCHAR2,

    P_COD2 NUMBER,

    P_COD3 NUMBER) RETURN VARCHAR2;

    PROCEDURE PL_Prod (P_CURSOR1 ON C_RETURN);

    Package body:


    Function PL_Fun)

    P_COD1 IN VARCHAR2,

    P_COD2 NUMBER,

    P_COD3 NUMBER) RETURN VARCHAR2 AS

    SALIDA VARCHAR2 (3000);

    BEGIN

    Salida: ='XXXXX1; YYYYY1; S |

    XXXXX2; YYYYY2; S |

    XXXXX3; YYYYY3; S |

    XXXXX41; YYYYY4; S |' ;

    RETURN of SALIDA;

    END PL_FUN;

    PROCEDURE PL_Prod (P_CURSOR1 ON C_RETURN) IS

    nothing exceptional;

    V_CODERROR VARCHAR2 (3);

    V_DESERROR varchar2 (300);

    BEGIN

    OPEN FOR P_CURSOR1

    SELECT PL_Fun (table1.v_cod1, )

                                           table1.v_cod2,

                                           table1.v_cod3) as description

    FROM TABLE1;

    EXCEPTION

    When is nothing THEN

    V_CODERROR: = '001';

    V_DESERROR: = 'nothing. '

    RAISE_APPLICATION_ERROR (-20000

    V_CODERROR | ':' || V_DESERROR

    );

    WHILE OTHERS THEN

    V_CODERROR: = 'SQL ';

    V_DESERROR: =.

    «ERROR ON PL_Fun (' |)» SQLCODE. ') ' || SUBSTR (SQLERRM

    1

    300

    );

    RAISE_APPLICATION_ERROR (-20000

    V_CODERROR | ':' || V_DESERROR);

    END PL_Prod;

    Error:

    Error: PLS-00231: function 'PL_Fun' is not usable in SQL

    Text:, PL_Fun (P_COD_1, P_COD_2, P_COD_3) as description

    Error: PL/SQL: ORA-00904: invalid identifier

    Text:, PL_Fun (P_COD_1, P_COD_2, P_COD_3) as description

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

    Text :);

    What I'm trying?

    Like ask Tom reffers, I changed the position of the packet body,

    From:

    Function PL_Fun ();

    PROCEDURE PL_Prod;

    TO:

    PROCEDURE PL_Prod;

    Function PL_Fun ();


    But it did not work. I have the same problem.


    And, as I read on another forum, I used the PRAGMA RESTRICT_REFERENCES like the following, but it doesn't work either:

    CREATING a PACKAGE LIKE xxxx

    Function PL_Fun)

    P_COD1 IN VARCHAR2,

    P_COD2 NUMBER,

    P_COD3 NUMBER) RETURN VARCHAR2;

    RESTRICT_REFERENCES PRAGMA (PL_Fun, WNDS, WNPS);

    PROCEDURE PL_Prod (P_CURSOR1 ON C_RETURN);

    END xxxx;



    Any suggestions?


    Thank you guys.

    Finally... solved. Break for a cup of coffee and lunch... and there's the problem: the function parameters where the same is called not on the statement and the area of the body area. The problem was just a letter. However, none of us (team work) noticed.

    Sorry for that and I THANK YOU all for your patience.

  • Cursor of procedure statement package

    Hi am facing these issues, I'm too close to the problem to understand. Pl help
    procedure addRox(p_reg_type_id in  number, p_offender_id in  number,p_sentence_end_date in  date,
                                p_registration_date in  date,p_end_registration_date in  date,
                                p_aggravated in  varchar2,p_habitual in  varchar2, p_comments  in varchar2, p_status  in varchar2 DEFAULT null  , p_OFFENSE_CODE in number) is
     
     
      cursor tierNum is
        select max(c.tier) from sor_offense o, sor_offense_code c
        where o.offender_id = p_offender_id
        and o.offense_code = c.CODE_ID
        and o.state = 30658
        and upper(o.status) = 'ACTIVE';
      tier number;
      vEndRegDate registration_offender_xref.END_REGISTRATION_DATE%type default null;
     begin
         open tierNum;
         Fetch tierNum into tier;
          if tierNum%NotFound then
            tier := Null;
          end if;
        Close tierNum;
        
      
        if tier is not null then 
          if(p_sentence_end_date is null) then -- sentenceEndDate is null 
              if tier = 1 then
              vEndRegDate := add_months(p_registration_date - 1,180);
              end if;
            if tier = 2 then
              vEndRegDate := add_months(p_registration_date - 1,300);
            end if;
            if tier = 3 then
                vEndRegDate := Null;
            end if;
          else -- sentence_end_date is not null 
            if tier = 1 then 
              vEndRegDate := add_months(p_sentence_end_date - 1,180);
            end if;
            if tier = 2 then
              vEndRegDate := add_months(p_sentence_end_date - 1,300);
            end if;
            if tier = 3 then
              vEndRegDate := Null;
            end if;
            
          end if; 
        end if; 
    
     
              insert into registration_offender_xref (reg_type_id, offender_id, status,sentence_end_date,
                                registration_date,end_registration_date,aggravated,habitual,status_date, comments)
                         values (p_reg_type_id, p_offender_id, 'Active',p_sentence_end_date,
                                p_registration_date,vEndRegDate,p_aggravated,p_habitual,sysdate, p_comments);
            
            -- commit;
    
     exception
      when others then
            
            DBMS_OUTPUT.PUT_LINE('ERR in  '||sqlerrm);
           
     end addRox;
    \

    Error:error (4.12): PLS-00323: subprogram or cursor "ADD_ABC" is declared in a package specification and must be defined in the package body

    Someone advised me two or three days back, the cursor is ineffective, you should try to do stuff in sql itself. This isn't the exact solution to the question above. But works for me.
    THUS, instead of cursor selects variables in the body of proc.

    Thank you

  • Package compilation error

    Version of database

    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

    PL/SQL Release 11.2.0.2.0 - Production

    "CORE 11.2.0.2.0 Production."

    AMT for 32-bit Windows: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Hi gurus

    I like to read Oracle PL/SQL Programming, 6th edition - O'Reilly Media by Steven Feuerstein and there, I can see the following code:

    Package specifications

    CREATE OR REPLACE

    PACKAGE restaurant_pkg

    IS

    TYPE item_list_t

    IS

    TABLE OF THE VARCHAR2 (30);

    PROCEDURE eat_that)

    items_in IN item_list_t,

    IN BOOLEAN make_it_spicy);

    END;

    /

    Package body

    CREATE OR REPLACE

    Restaurant_pkg body PACKAGE

    IS

    PROCEDURE eat_that)

    items_in IN item_list_t,

    IN BOOLEAN make_it_spicy_in_in)

    IS

    BEGIN

    FOR indx IN 1... items_in. COUNTY

    LOOP

    Dbms_output.put_line

    (

    CASE

    WHEN make_it_spicy_in_in THEN

    "Spicy."

    END | items_in (indx));

    END LOOP;

    END;

    END restaurant_pkg;

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

    but the problem is I get the error at compile time, please advice:

    Error

    Error (5.13): PLS-00323: subprogram or cursor "EAT_THAT" is declared in a package specification and must be defined in the package body

    Thanks in advance

    Concerning

    Shu

    The second parameter in the package body is make_it_spicy_in_in, while in the specifications, it is called make_it_spicy

  • Procedure is not recognized in the package body

    I have this error message:

    Compile for HR.MILOS_PACKAGE BODY of PACKAGE errors

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

    Online: 19

    Text: IF (l_exists)

    I deffined in the whole of the body after the first procedure that is no problem.

    I don't know what the problem is. There is no other sugestions compiler.

    Procedure works very well when packing.

    PROCEDURE RAISE_SALARY (p_perc p_dep_id NUMBER, NUMBER) IS

    v_emp_id employees.employee_id%TYPE;

    v_sal employees.salary%TYPE;

    v_avg_sal employees.salary%TYPE;

    CURSOR c_salaries IS SELECT employee_id, salary employees

    If NOT EXISTS (SELECT 1 from employees e WHERE e.manager_id = employees.employee_id)

    and department_id = p_dep_id;

    CURSOR c_salaries_m IS SELECT employee_id, salary employees

    WHERE employe_id IN (SELECT distinct manager_id of employees)

    and department_id = p_dep_id;

    Start

    SELECT AVG (salary) IN the v_avg_sal FROM Employees WHERE department_id = p_dep_id;

    OPEN c_salaries.

    LOOP

    EXTRACT c_salaries INTO v_emp_id, v_sal;

    EXIT WHEN c_salaries % NOTFOUND;

    IF v_sal + 1 > 3 * v_avg_sal

    THEN UPDATE employees SET salary = 3 * v_avg_sal

    WHERE employe_id = v_emp_id;

    UPDATE of OTHER employees SET salary = salary * to_number ('1' |'.) ' || p_perc)

    WHERE employe_id = v_emp_id;

    END IF;

    END LOOP;

    CLOSE C_salaries;

    OPEN c_salaries_m.

    LOOP

    EXTRACT c_salaries_m INTO v_emp_id, v_sal;

    EXIT WHEN c_salaries_m % NOTFOUND;

    IF v_sal + 5 > 3 * v_avg_sal

    THEN UPDATE employees SET salary = 3 * v_avg_sal

    WHERE employe_id = v_emp_id;

    UPDATE of OTHER employees SET salary = salary * to_number ('1' |'.) ' || (p_perc + 50))

    WHERE employe_id = v_emp_id;

    END IF;

    END LOOP;

    CLOSE C_salaries_m;

    end RAISE_SALARY;

    Compile for HR.MILOS_PACKAGE BODY of PACKAGE errors

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

    We hear... you have defined the raise_salary procedure in the package specification but not in the package body. (pretty clear)

    not in the package body means:

    the statement could be different...

    PROCEDURE RAISE_SALARY (NUMBER, p_dep_id NUMBER p_perc)

    so:

    are identical named parameters?

    they have identical data types?

    vary according to the assigned default values?

    vary according to its use (IN/OUT/IN OUT) - (why did not specify the use anyway?)

    HTH

  • Creating a package

    Hello
    CREATE OR REPLACE PACKAGE EMPDETAILS_PG AS
    
    TYPE RCT1 IS REF CURSOR;
    
    procedure get_empdetails
    (
    p_empno                   in number,
    P_refcursor_out          in out RCT1
    );
    
    END EMPDETAILS_PG; 
    CREATE OR REPLACE PACKAGE BODY EMPDETAILS_PG AS
    
    procedure get_empdetails
    (
    p_empno                   in varchar2,
    p_refcursor_out          in out RCT1
    ) 
    IS
    
    v_empno number := p_empno;
    BEGIN
    
    open p_refcursor_out for 
    select 
    EMPNO,
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    COMM,
    DEPTNO from parisiemp where empno = v_empno;
    
    close p_refcursor_out;
    
    End get_empdetails;
    
    END EMPDETAILS_PG; 
    I get the error message like "PLS-00323: subprogram or cursor"GET_EMPDETAILS"is declared in a package specification and must be defined in the package body.

    Please help solve this problem.

    Thank you
    Gregory

    In package specifications

    procedure get_empdetails
    (
    p_empno number,
    P_refcursor_out in the RCT1
    );

    In the package body

    procedure get_empdetails
    (
    p_empno in varchar2,
    p_refcursor_out in the RCT1
    )

    Your first p_empno parameter is of a different data type. This is incorrect.

  • function table in pipeline

    CREATE TABLE  TXN
    (
      SYS_ID       NUMBER,
      TXN_CODE  VARCHAR2(12),
       TXN_NO    NUMBER
    );
    
    SELECT SYS_ID,TXN_CODE, TXN_NO FROM TXN ORDER BY 1
    
    
    
    CREATE OR REPLACE TYPE TXN AS OBJECT 
    (
      SYS_ID     NUMBER(12),
      TXN_CODE   VARCHAR2(12),
      TXN_NO     NUMBER,
      
    )
    
    
    CREATE OR REPLACE TYPE TXN_DATA AS TABLE OF TXN
    
    
    
    CREATE OR REPLACE PACKAGE PKG 
    AS
       FUNCTION TXN(SYS_ID NUMBER) 
       RETURN TXN_DATA PIPELINED;
    END;
    
    
    CREATE OR REPLACE PACKAGE BODY  PKG AS 
    FUNCTION  TXN RETURN TXN_DATA PIPELINED IS
    BEGIN
      FOR I IN 1..NVL(SYS_ID,999999999)
        LOOP
          PIPE ROW(TXN(SYS_ID));
        END LOOP;
        RETURN;
       END;
    END;       
    
    
    I am getting the following errors while executing the package..
    
    PLS-00201: Indentifier SYS_ID must be declared
    PLS-00323: subprogram or cursor TXN is declared in a package specification and must be defined in the package body
    
    Kindly suggest the solution ?
    
    Sanjay 

    user12957777 wrote:
    I want to use the Pipelined function to write a single line instead of complex query query.

    Evil. This is done by using views. Tables not channelled burst.

    The latter is mainly used for the transformation of data. Unfortunately, it seems to serve often stupid hacks. Hacks which decrease only scalability performance and limits.

    Be very sure of the way in which a function table of pipeline works and what are its benefits, before using it.

  • Invalid FND_STATS

    Hello friends

    I recently updated my EBS 11.5.10 to 11.5.10.2 @CU2, my DB is 9.2.0.6 and BONES id HP UX 11.11

    When I compiled the invalid objects, one object is invalid, it is FND_STATS, how to validate for her

    all ideas

    I tried to change the package bodies to compile the package, but it gives the error

    SQL > alter the body of package FND_STATS compilation;

    WARNING: The bodies of Package modified with compilation errors.

    SQL > show error
    PACKAGE BODY FND_STATS errors:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    253/11 PLS-00323: subprogram or cursor "LOAD_XCLUD_TAB" is declared in a
    specification package and must be defined in the package body

    Please help me solve this error

    In addition to AFSTATSB.pls, you must run AFSTATSS.pls also. Make sure you only take before making a backup of the existing package.

    -AFSTATSB.pls: Body of PL/SQL for the package: FND_STATS
    -AFSTATSS.pls: PL/SQL for the package Specification: FND_STATS

  • Could not understand the error in help kindly cursor me

    declare
    cursor c is select e.empno,e.ename,g.grade from emp e,salgrade g where e.sal between g.losal and g.hisal order by e.empno;
    v_empno emp.empno%type;
    v_ename emp.ename%type;
    v_grade salgrade.grade%type;
    begin
    open c;
    fetch c into v_empno,v_ename,v_grade;
    while c%rowcount<=5 
    loop
    dbms_output.put_line(c.empno||' '||c.ename||' '||c.grade);
    end loop;
    close c;
    end;
    Error on line 2
    ORA-06550: line 11, column 24:
    PLS-00225: subprogram or cursor reference 'C' is out of range
    ORA-06550: line 11, column 1:
    PL/SQL: Statement ignored

    Script done on line 2.

    the order of the statements in the loop had some prob, so you must use local variables.
    Try the following.

    declare
    cursor c is select e.empno,e.ename,g.grade from emp e,salgrade g where e.sal
    between g.losal and g.hisal order by e.empno;
    v_empno emp.empno%type;
    v_ename emp.ename%type;
    v_grade salgrade.grade%type;
    begin
    while c%rowcount <= 5
    loop
    open c;
    fetch c into v_empno,v_ename,v_grade;
    dbms_output.put_line (v_empno||' '||v_ename||' '||v_grade);
    end loop;
    close c;
    end;
    

Maybe you are looking for