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.

Tags: Database

Similar Questions

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

  • Return of the ref cursor of procedure where the cursor is defined in the specification

    Hello

    Here's pseudo-code

    create or replace package test
    as
    cursor c_emp (number cv_emp_id)
    is
    Select emp_name emp where emp_id = cv_emp_id;

    type ref_c is ref cursor;

    function get_emp_name (number p_emp_id) return ref_c;
    end test;
    /


    create or replace the test physics package
    as
    ref_c function get_emp_name (number p_emp_id)
    is
    ret_val ref_c;
    Start
    Open c_emp (p_emp_id);
    ret_val: = c_emp;
    return ret_val;

    end get_emp_name;
    end test;
    /

    Returns me "PLS-00382: expression is of the wrong type. I tried to use a strongly typed Ref cursor based on the cursor, but nothing helped.

    Clearly, I understand something... and if I can't assign as ' ret_val: = c_emp "and if there is another key way it so please let me know.

    Thank you

    Ralph

    Published by: user13024707 on May 5, 2010 04:43

    user13024707 wrote:
    Clearly the point of my question is being missed.

    Or maybe the question is not been clearly asked. ;)

    I want to set the cursor in the PACKAGE SPECIFICATION, and not in the package body. The issue of the bind variable and the string is neither here nor there because I pass parameters to the cursor.

    What you ask is to use a PL/SQL cursor (defined in the specifications of the package or elsewhere) and that convert a Ref Cursor. N ° cannot be done.
    PL/SQL cursors should be used in the PL/SQL code. REF CURSOR is primary used to pass back a reference to a cursor (and all queries are cursors) to a layer of application outside of PL/SQL for example .net, java, etc.. Once you start using the ref Cursor only really, you have the choice of opening it based on a (dynamic) or a fixed query string as in the examples given. You cannot open a cursor of a PL/SQL cursor definition Ref.

    The difference is that when you do:

      CURSOR cur_mycursor IS
        SELECT ...
    

    you declare a cursor in pl/sql definition, not actually a slider itself. The cursor itself is created when you issue an OPENING or a statement FOR etc. So a Ref Cursor (reference to a slider) cannot refer to the definition of the cursor because it is only a definition, not a cursor (i.e. it has not been sent engine sql and instantiated at that time here). Instead the Ref Cursor must reference a cursor (query), itself, and that may be presented as a string or as the query itself that is issued against the sql engine and then the ref cursor points

    Thus, slider ref and PL/SQL cursors are different concepts, both designed to manage cursors in a slightly different way of programming. You cannot mix them.

  • PLS-00304: cannot compile &lt; package &gt; body without its specification

    Hi all
    When compiling the below pasted together, I got the following error msg.
    PL/SQL: Compilation unit analysis terminated
    PLS-00304: cannot compile body of 'EDR_RPT_CLASS_BY_TAWT_PACKAGE'
    without its specification
    
    PLS-00905: object HDOT.EDR_RPT_CLASS_BY_TAWT_PACKAGE is invalid
    But me, which forfeit and ppackage specification of the body properly. Please could someone help me find the error

    CREATE OR REPLACE PACKAGE edr_rpt_class_by_tawt_package AS
    
    
    PROCEDURE edr_rpt_gen_class_by_tawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    );
    
    PROCEDURE edr_rpt_gen_class_by_fawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    );
    
    PROCEDURE edr_rpt_gen_class_by_sawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    );
    
    
    PROCEDURE edr_rpt_gen_class_by_triawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    );
    
    PROCEDURE edr_rpt_gen_class_by_qawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    );
    
    FUNCTION  class_count
    (
      in_lane_id                  edr_rpt_by_ranges_output.lane_id%TYPE,
      in_direction_id             edr_rpt_by_ranges_output.direction_id%TYPE,
      in_interval_start_date_time edr_rpt_by_ranges_output.interval_start_date_time%TYPE,
      in_interval_end_date_time   edr_rpt_by_ranges_output.interval_start_date_time%TYPE,
      in_axle_wt_min              edr_cls_by_tawt_report_data.group_weight%TYPE,
      iin_axle_wt_max             edr_cls_by_tawt_report_data.group_weight%TYPE,
      in_class_min                edr_cls_by_tawt_report_data.vehicle_class%TYPE,
      in_class_max                edr_cls_by_tawt_report_data.vehicle_class%TYPE
    )
    RETURN VARCHAR2;
    
    
    END edr_rpt_class_by_tawt_package;
    /
    
    CREATE OR REPLACE PACKAGE BODY edr_rpt_class_by_tawt_package AS
    
       c_front_axle_only         CONSTANT axle_class.group_type%TYPE := -1;
       c_axle_single_group_type  CONSTANT axle_class.group_type%TYPE := 1;
       c_axle_tandem_group_type  CONSTANT axle_class.group_type%TYPE := 2;
       c_axle_tridem_group_type  CONSTANT axle_class.group_type%TYPE := 3;
       c_axle_quadrem_group_type CONSTANT axle_class.group_type%TYPE := 4;
       c_kips_conversion_unit_id CONSTANT units.unit_id%TYPE         := 8;
    
       v_report_axle_group_type  axle_class.group_type%TYPE := 0;
    
    
    FUNCTION  class_count
    (
      in_lane_id                  edr_rpt_by_ranges_output.lane_id%TYPE,
      in_direction_id             edr_rpt_by_ranges_output.direction_id%TYPE,
      in_interval_start_date_time edr_rpt_by_ranges_output.interval_start_date_time%TYPE,
      in_interval_end_date_time   edr_rpt_by_ranges_output.interval_start_date_time%TYPE,
      in_axle_wt_min              edr_cls_by_tawt_report_data.group_weight%TYPE,
      in_axle_wt_max              edr_cls_by_tawt_report_data.group_weight%TYPE,
      in_class_min                edr_cls_by_tawt_report_data.vehicle_class%TYPE,
      in_class_max                edr_cls_by_tawt_report_data.vehicle_class%TYPE
    )
    RETURN NUMBER
    IS
      my_count_result NUMBER(18);
    BEGIN
    
       SELECT NVL(SUM(vehicle_count), 0 )
       INTO my_count_result
       FROM
           (
            SELECT site_lane_id
            FROM   edr_rpt_tmp_report_lanes
            WHERE  edr_rpt_tmp_report_lanes.output_lane_id        = in_lane_id
              AND  edr_rpt_tmp_report_lanes.output_direction_id   = in_direction_id
           ) report_lanes
       JOIN edr_cls_by_tawt_report_data
         ON edr_cls_by_tawt_report_data.site_lane_id          = report_lanes.site_lane_id
       WHERE edr_cls_by_tawt_report_data.bin_start_date_time >= in_interval_start_date_time
         AND edr_cls_by_tawt_report_data.bin_start_date_time <  in_interval_end_date_time
         AND edr_cls_by_tawt_report_data.group_weight >= in_axle_wt_min
         AND edr_cls_by_tawt_report_data.group_weight  < in_axle_wt_max  
         AND edr_cls_by_tawt_report_data.vehicle_class >= in_class_min
         AND edr_cls_by_tawt_report_data.vehicle_class <= in_class_max
         ;
    
       RETURN my_count_result;
    END;
    
    
    FUNCTION get_row_class_counts_text
    RETURN VARCHAR2
    IS
       my_row_counts_text  VARCHAR2(10000);
       my_row_counts_entry  VARCHAR2(10000);
    
       CURSOR row_counts_text IS
         SELECT 'edr_rpt_class_by_tawt_package.class_count('
                           ||'lane_id, '
                           ||'direction_id, '
                           ||'interval_start_date_time, '
                           ||'interval_end_date_time, '
                           ||'range_low, '
                           ||'range_high, '
                           || class_id || ', '
                           || class_id || ') "'|| class_id || '"'
         FROM edr_rpt_tmp_report_classes
         ORDER BY class_id;
    
    BEGIN
    
      my_row_counts_text   := '';
      my_row_counts_entry  := '';
    
      -- generate the speed ranges function calls
      OPEN row_counts_text;
      LOOP
    
        FETCH row_counts_text INTO my_row_counts_entry;
    
        EXIT WHEN row_counts_text%NOTFOUND;
    
        my_row_counts_text := my_row_counts_text || ', ' || my_row_counts_entry;
    
      END LOOP;
      CLOSE row_counts_text;
    
      RETURN my_row_counts_text;
    
    END;
    
    
    
    FUNCTION get_row_totals_text
    RETURN VARCHAR2
    IS
       my_row_count_total_text  VARCHAR2(10000);
    BEGIN
    
      my_row_count_total_text := '';
    
      -- generate the 'total' column function call
      SELECT 'edr_rpt_class_by_tawt_package.class_count('
                           ||'lane_id, '
                           ||'direction_id, '
                           ||'interval_start_date_time, '
                           ||'interval_end_date_time, '
                           ||'range_low, '
                           ||'range_high, '
                           || MIN(class_id) || ', '
                           || MAX(class_id) || ') " "'
      INTO my_row_count_total_text
      FROM edr_rpt_tmp_report_classes;
    
      RETURN ', ' || my_row_count_total_text;
    
    END;
    
    
    
    PROCEDURE apply_default_awt_ranges(in_report_parameter_id   IN   NUMBER)
    IS
    
      my_awt_ranges_count NUMBER(4);
    
    BEGIN
    
     SELECT nvl(count(1),0)
     INTO my_awt_ranges_count
     FROM report_range_parameters
     WHERE REPORT_PARAMETER_ID = in_report_parameter_id
       AND REPORT_PARAMETER_GROUP = 'AXLE_GROUP'
       AND REPORT_PARAMETER_NAME = 'AXLE_NAME';
    
     IF  ( my_awt_ranges_count = 0 )
     THEN
      INSERT INTO report_range_parameters (REPORT_PARAMETER_ID, REPORT_PARAMETER_GROUP, REPORT_PARAMETER_NAME, REPORT_PARAMETER_MIN_VALUE, REPORT_PARAMETER_MAX_VALUE)
        VALUES (in_report_parameter_id, 'AXLE_GROUP', 'AXLE_NAME', '0', '2'); 
        VALUES (in_report_parameter_id, 'AXLE_GROUP', 'AXLE_NAME', '30', '32');
     END IF;
    
    END;
    
    
    PROCEDURE edr_class_by_tawt_use_per_veh
    (
       in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
       in_good_status_mask      IN      NUMBER
    )
    IS
    
     max_axle_group_value NUMBER(12);
    
    BEGIN
    
      DELETE FROM edr_cls_by_tawt_report_data;
     
      COMMIT;
    
      INSERT INTO edr_cls_by_tawt_report_data
                    (
                      site_id,
                      site_lane_id,
                      site_direction_id,
                      site_direction_name,
                      bin_start_date_time,
                      group_weight,
                      bin_id,
                      bin_value
                     )
      SELECT site_id,
             site_lane_id,
             site_direction_id,
             site_direction_name,
             date_time,
             group_weight,
             vehicle_class,
             COUNT(vehicle_class)
      FROM
             (
               SELECT edr_cls_by_tawt_per_veh_data.*
                 FROM edr_cls_by_tawt_per_veh_data           
         GROUP BY date_time,
               site_lane_id,
               group_weight,
               vehicle_class,
               site_id,
               site_direction_id,
               site_direction_name;
    
    END edr_class_by_tawt_use_per_veh;
    
    
    PROCEDURE edr_class_by_tawt_data_type
    (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      in_good_status_mask      IN      NUMBER,
      in_data_type             IN      VARCHAR2,
      out_data_type_used          OUT  VARCHAR2
    )
    IS
      my_bin_entry_count   NUMBER(12,0);
      my_veh_entry_count   NUMBER(12,0);
    BEGIN
    
      IF(UPPER(in_data_type) = 'BINNED') THEN
    
        --  Axle information can only be read from Per Vehicle data records
        --   - using bins-only is not a supported option
        RAISE_APPLICATION_ERROR(-20101,'Binned data cannot be used for this report.');
    
    
      ELSIF    (UPPER(in_data_type) = 'PERVEHICLE')
            OR (UPPER(in_data_type) = 'COMBINED')
      THEN
    
        out_data_type_used := 'Per Vehicle (All Vehicles)';
    
        edr_class_by_tawt_use_per_veh( in_report_parameter_id, in_good_status_mask );
    
      ELSE
         RAISE_APPLICATION_ERROR(-20101,'The data type specified is not recognized.');
      END IF;
    
    END edr_class_by_tawt_data_type;
    
    
    PROCEDURE edr_class_by_tawt_get_veh_data
    (
      in_report_parameter_id   IN   NUMBER,
      in_site_id               IN   NUMBER,
      in_start_date_time       IN   TIMESTAMP,
      in_end_date_time         IN   TIMESTAMP,
      in_report_level_min      IN   NUMBER,
      in_report_level_max      IN   NUMBER
    )
    IS
    
    BEGIN
     
      DELETE FROM edr_cls_by_tawt_per_veh_data;
    
      INSERT INTO edr_cls_by_tawt_per_veh_data
            (
              site_id,
              site_lane_id,
              site_direction_id,
              site_direction_name,
              record_id,
              date_time,
              group_weight,
              vehicle_class,
              group_number,
              vehicle_status,
              vehicle_error_count,
              axle_violations_count,
              group_type          
            )
      SELECT axle_info.site_id,
             axle_info.site_lane_id,
             axle_info.site_direction_id,
             axle_info.site_direction_name,
             axle_info.record_id,
             axle_info.datetime,
             axle_info.group_weight,
             axle_info.v_class,
             axle_info.group_number,
             NVL((SELECT SUM(status_code)
                    FROM traffic_status
                   WHERE traffic_status.record_id = axle_info.record_id), 0) vehicle_status,
             NVL((SELECT COUNT(error_code)
                    FROM traffic_error
                   WHERE traffic_error.record_id = axle_info.record_id), 0) vehicle_error_count,
             NVL((SELECT COUNT(1)
                    FROM axle_weight_violation
                   WHERE axle_weight_violation.record_id = axle_info.record_id), 0) axle_violations_count,
             axle_info.group_type            
        FROM (SELECT site_to_data_source_lane_v.site_id,
                     site_to_data_source_lane_v.site_lane_id,
                     site_to_data_source_lane_v.site_direction_id,
                     site_to_data_source_lane_v.site_direction_name,
                     traffic_record.record_id,
                     traffic_record.datetime,
                     NVL(traffic_class.v_class, 0)   v_class,
                     NVL(axle_class.group_type, 0)   group_type,
                     NVL(axle_class.group_number, 0) group_number,                
                     NVL(TRUNC(sum(convert_units(axle.weight_unit_id,
                                             c_kips_conversion_unit_id,
                                             axle.axle_weight
                                            )
                               )
                           ),
                           0
                         ) group_weight
               FROM  traffic_record
               JOIN  site_to_data_source_lane_v
                 ON  traffic_record.data_source_id = site_to_data_source_lane_v.data_source_id
                AND  traffic_record.lane = site_to_data_source_lane_v.data_source_lane_id                    
           GROUP BY site_to_data_source_lane_v.site_id,
                     site_to_data_source_lane_v.site_lane_id,
                     site_to_data_source_lane_v.site_direction_id,
                     site_to_data_source_lane_v.site_direction_name,
                     traffic_record.record_id,
                     traffic_record.datetime,
                     traffic_class.v_class,                 
                     axle_class.group_type,
                     axle_class.group_number
            ) axle_info
       
    
    END edr_class_by_tawt_get_veh_data;
    
    
    PROCEDURE gen_class_by_axle_type
    (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    )
    AS
    
     
    BEGIN
     
      apply_default_awt_ranges(in_report_parameter_id);
    
      my_date_format_mask   := edr_rpt_generic_package.edr_rpt_get_date_format_mask(in_report_parameter_id);
      my_start_date_time    := edr_rpt_generic_package.edr_rpt_get_start_date_time(in_report_parameter_id, my_date_format_mask);
      my_end_date_time      := edr_rpt_generic_package.edr_rpt_get_end_date_time(in_report_parameter_id, my_date_format_mask);
      my_lane_grouping      := edr_rpt_generic_package.edr_rpt_get_lane_grouping(in_report_parameter_id);
      my_site_id            := edr_rpt_generic_package.edr_rpt_get_site_id(in_report_parameter_id);
      my_selected_data_type := edr_rpt_generic_package.edr_rpt_get_data_type(in_report_parameter_id);
    
      -- ensure selected classes and lanes temp tables have been populated
      edr_rpt_generic_package.edr_rpt_gen_tmp_lanes(in_report_parameter_id);
      edr_rpt_generic_package.edr_rpt_gen_tmp_classes(in_report_parameter_id);
      edr_rpt_generic_package.edr_rpt_gen_tmp_speed_ranges(in_report_parameter_id);
    
      my_good_weight_statuses_mask   := edr_rpt_generic_package.get_good_weight_status_mask(in_report_parameter_id);
    
    
      edr_rpt_generic_package.edr_rpt_gen_inclusion_table
      (
        in_report_parameter_id,
        my_date_format_mask,
        my_start_date_time,
        my_end_date_time
      );
    
      edr_rpt_generic_package.edr_rpt_gen_grouping_table
      (
        in_report_parameter_id,
        my_date_format_mask,
        my_start_date_time,
        my_end_date_time
      );
    
      edr_class_by_tawt_get_veh_data
      (
        in_report_parameter_id,
        my_site_id,
        my_start_date_time,
        my_end_date_time,
        0,                          --Hardcoded until reclassification is supported.
        0                           --Hardcoded until reclassification is supported.
      );
    
      edr_class_by_tawt_data_type
      (
        in_report_parameter_id,
        my_good_weight_statuses_mask,
        my_selected_data_type,
        my_used_data_type
      );
    
    
      edr_rpt_generic_package.gen_rpt_by_ranges_output_table
      (
        in_report_parameter_id,
        'AXLE_GROUP',
        'AXLE_NAME'
      );
    
      COMMIT;
      my_report_data_statement :=
          ' SELECT rank "Rank", '
        ||       ' row_type "Row Type", '
        ||       ' interval_start_date_time "Date", '
        ||       ' interval_start_date_time, '
        ||       ' range_label "Chart X-Axis", '
        ||       ' lane_id "Group Id" , '
        ||       ' ''None'' "Group Name", '
        ||       ' range_label "Speed (mph)" '
        ||         get_row_class_counts_text
        ||         get_row_totals_text
        ||       ' FROM edr_rpt_by_ranges_output '
        ||       ' ORDER BY lane_id, '
        ||                ' direction_id, '
        ||                ' interval_start_date_time, '
        ||                ' range_high, '
        ||                ' rank, '
        ||                ' range_low'
        ;
    
      dbms_output.put_line('SQL start------------------------');
      dbms_output.put_line(my_report_data_statement);
      dbms_output.put_line('SQL end--------------------------');
    
    
      my_chart_data_statement :=
           ' SELECT range_low "X Axis", '
        ||        ' lane_id "Group" '
        ||         get_row_class_counts_text
        || ' FROM '
        || ' ( '
        || ' SELECT lane_id, '
        ||        ' direction_id, '
        ||        ' range_low, '
        ||        ' range_high, '
        ||        ' min(interval_start_date_time) interval_start_date_time, '
        ||        ' max(interval_end_date_time) interval_end_date_time '
        || ' FROM edr_rpt_by_ranges_output '
        || ' WHERE rank = 1 '
        || ' GROUP BY lane_id, direction_id, range_low,  range_high '
        || ' ) '
        || ' order by "Group", range_low '
        ;
    
      dbms_output.put_line('SQL start------------------------');
      dbms_output.put_line(my_chart_data_statement);
      dbms_output.put_line('SQL end--------------------------');
    
    
    
      SELECT my_used_data_type
        INTO my_data_type_used
        FROM SYS.DUAL;
    
      SELECT NVL(COUNT(DISTINCT record_id), 0)
        INTO my_per_vehicle_total
        FROM edr_cls_by_tawt_per_veh_data;
    
      SELECT NVL(COUNT(DISTINCT record_id), 0)
        INTO my_status_vehicle_total
        FROM edr_cls_by_tawt_per_veh_data
       WHERE vehicle_status > 0
         AND vehicle_error_count = 0;
    
    
      SELECT NVL(COUNT(DISTINCT record_id), 0)
        INTO my_error_vehicle_total
        FROM edr_cls_by_tawt_per_veh_data
       WHERE vehicle_error_count > 0;
    
    
      SELECT NVL(COUNT(DISTINCT record_id), 0)
        INTO my_status_clear_total
        FROM edr_cls_by_tawt_per_veh_data
       WHERE vehicle_status = 0
         AND vehicle_error_count = 0;
    
    
      SELECT NVL(COUNT(1), 0)
        INTO my_binned_vehicle_total
        FROM edr_cls_by_tawt_per_veh_data;
    
      SELECT NVL(COUNT(1), 0)
        INTO my_good_weight_total
        FROM edr_cls_by_tawt_per_veh_data
       WHERE vehicle_error_count = 0
         AND BITAND(vehicle_status, my_good_weight_statuses_mask) = 0;
    
      -- insert vehicle totals into the temporary table
      DELETE FROM edr_rpt_tmp_veh_totals_table;
    
      INSERT INTO edr_rpt_tmp_veh_totals_table
      SELECT my_data_type_used,
             my_per_vehicle_total,
             my_binned_vehicle_total,
             my_error_vehicle_total,
             my_status_vehicle_total,
             my_good_weight_total,
             my_status_clear_total
        FROM SYS.DUAL;
    
      -- execute the query into the output refcursor
      OPEN report_data FOR
        my_report_data_statement;
    
      OPEN chart_data FOR
        my_chart_data_statement;
    
      OPEN footer_data FOR
        SELECT data_type_used,
               per_vehicle_total,
               binned_vehicle_total,
               error_vehicle_total,
               status_vehicle_total,
               good_weight_total,
               status_clear_total
          FROM edr_rpt_tmp_veh_totals_table;
    
    END gen_class_by_axle_type;
    
    PROCEDURE edr_rpt_gen_class_by_sawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    )
    AS
    BEGIN
      v_report_axle_group_type := c_axle_single_group_type;
      gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data);
    END;
    
    PROCEDURE edr_rpt_gen_class_by_fawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    )
    AS
    BEGIN
      v_report_axle_group_type := c_front_axle_only ;
      gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data);
    END;
    
    PROCEDURE edr_rpt_gen_class_by_tawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    )
    AS
    BEGIN
      v_report_axle_group_type := c_axle_tandem_group_type;
      gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data);
    END;
    
    PROCEDURE edr_rpt_gen_class_by_triawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    )
    AS
    BEGIN
      v_report_axle_group_type := c_axle_tridem_group_type;
      gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data);
    END;
    
    PROCEDURE edr_rpt_gen_class_by_qawt (
      in_report_parameter_id   IN      report_tasks.report_task_id%TYPE,
      report_data              OUT     SYS_REFCURSOR,
      chart_data               OUT     SYS_REFCURSOR,
      footer_data              OUT     SYS_REFCURSOR
    )
    AS
    BEGIN
      v_report_axle_group_type :=  c_axle_quadrem_group_type;
      gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data);
    END;
    
    END edr_rpt_class_by_tawt_package;
    /
    
    
    LIST
    
    SHOW ERROR

    FUNCTION RETURN VARCHAR2 class_count in package specifications and
    FUNCTION RETURN NUMBER class_count in the package body.
    change the type of data SERVICE class_count

  • MacBook pro 2 logon screen starts with no arrow cursor and must be restarted

    2014 Macbook Pro screen Retina 2 13 "opening session starts with no arrow cursor and must be restarted once every five tests.  When the computer reboots, message appears asking you if it must open programs that had started to load or cancel.  It is a recent problem that does not occur two months ago.  Once restarted, everything seems to be OK.  That is what it is?

    Try the start mode by holding down the SHIFT key at startup. Secure boot is quite slow because the operating system performs some cleanup and verification tasks, so give it time. Once you're completely connected, restart normally.

  • Since the installation of Mac Mavericks all my friends with Macs and I have problems with the cursor disappears, that in Firefox, Safari is very good...

    I stopped using Firefox as nothing I've done has corrected this problem. I tried to close Firefox and restart it, I erased all my Add-ons and then added adblock back (it's the only one), but it still does not work. I deleted files so that I have more space - I can't think of anything that works. I talked to four of my friends with Macs and they are all having the same problem with Firefox since the Mavericks.

    Cursor disappears huh? It's quite strange. All of the compatibility of the Mavericks can be followed in [Bug 883824]

    Try this work around:

    1. Go to Firefox > Preferences > advanced > general
    2. Always check "use the cursor keys to navigate through the pages.
    3. Press OK.

    Or try the Mac preferences noted here: https://discussions.apple.com/message/23542890#24471966

  • When you tap on my new laptop, the cursor jumps around and letters are places in the words entered previously.

    New laptop yesterday. When you type, the cursor jumps back and letters are placed in the words entered previously?

    original title: keyboard probkem

    wendyjjll,
    Thank you for visiting the Microsoft Answers community forum.

    Most likely, the problem is due to the sensitivity of your touchpad.  Whenever you type, your thumb probably affects the touchpad with the cursor to another location where you type.  You can set the sensitivity of your touchpad, or turn off the tapping by going into settings start, Control Panel, mouse and keyboard.  If it is not under that, the manufacturer of the laptop most likely installed custom software to control the touchpad.  Let us know what kind of cell phone, brand and model, and we will be able to help you.

    Thank you

    Gloria
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • scrolling problems, running of the depot, retro-typing and cursor and windows boxes freezing in the process of disappearance. Help!

    I have a dell vostro 1000 laptop with windows Vista Basic program. I aggravating problems with scrolling, on each program Web site. I have mozilla firefox, chrome, IE I started to scroll down a page and he yanks back the Summit. This also happens offline. I feel like a tug of war. The other problem is the flashing running drop boxes. When I go to lets say google and I click on the search box type it then starts flashing and hurtling previous search words. It is difficult to stop this. right now I have some difficulties to type this question because I'm going to type a few words and then the cursor disappears also a previous sentence. Sometimes when I go to type a word in the search type box the first letter and then the cursor will return to the leading space and adds the letters before the first letter of the word. I feel like sometimes I write backwards. Oh! time comsuming. It does also offline. I have a wireless keyboard and mouse that I sometimes use the mouse works, then suddenly, the page is pulled to the top and I can only It control a few times with the arrow keys on your laptop. Sometimes, this work and others do not. My AutoFill will in to fill out the forms but the name, the address box etc. will follow down the rest of the form and I do not see other issues. I tried Control Panel for mouse problems and the keyboard and settings sometimes move for the reason so I can't set some options. Can someone please help me I've been struggling with this problem for over a year.

    Hi Butterfly3,

    Welcome to Microsoft Vista answers Forum!

    ·         Does the problem occur even when working with other programs such as WordPad and Notepad?

    (A.) it can happen that if drivers are not updated, you may update the drivers for keyboard and mouse on your machine, see steps to update the drivers:

    (i.) click Start > type in Device Manager in the start search > expand the keyboard and the mouse in Device Manager > right click on drivers > click Properties > click on the driver tab > click on update drivers > click OK.

    Now, restart the computer and check if the keyboard and mouse works fine without any problems.

    (B) if the problem persists, you may need to perform the analysis antivirus on the computer.

    You can also perform a complete analysis of the Service from the link: http://safety.live.com

    A.) you can also check by reducing the hardware acceleration on your computer, follow the steps below to reduce hardware acceleration:

    (i.) click Start > click Control Panel > click on appearance and personalization > click personalization > click on display settings > click Advanced settings > click the Troubleshooting tab, and then click on change settings.

    Note: The settings will be disabled if the graphics card driver does not support disabling hardware acceleration.

    Move the hardware acceleration slider until it is one notch to the right of none. It is the basis of acceleration.

    Click OK twice, and then close the window.

    (B) I suggest that you might have to reset the internet settings explorer explore on your computer, download the Microsoft Fix - it of the link which automatically resets the default browser settings, see the link: http://support.microsoft.com/923737

    Hope this information is useful.
    Let me know if it worked.
    All the best!

    Thank you, and in what concerns:
    Swathi B - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Boring bar often appears while the cursor around that stops he or she jumps into another section of the document

    A tiny little bar with arrows on each tip of the left and right side often appears under my cursor while I move it.  He stops the cursor or jump somewhere toward the bottom of the document.  I can't identify what it is because it disappears almost as soon as it appears.  Sometimes, I don't have to hit ESC to get rid of it, so I can again move my cursor.  I have a Toshiba laptop and use the internal mouse.  Anyone know what this could be and how I can disable it?

    The shape of the cursor you describe (a short bar with an arrow at each end) is the form that the cursor should automatically apply when it is on the edge of a window that can be resized or in certain types of document, when it is on a column header or something else that can be resized.  If you hold down the button of the mouse and make dragging the mouse while the cursor is in this form, the element below it needs to change size as trolling the mouse.  It will disappear almost as soon as it appears if the mouse move just above the area without the mouse down because it is no longer on the edge of the window, the column heading or what it is that can be resized.  It shouldn't stop your cursor to move, and I'm not aware of any way to turn it off.

  • my standard drawing tools in a given paper seem to be stuck in some kind of preset isometric drawing. someone knows how to get back to 'normal '. my cursor has a cross and an arrow pointing to the left.

    Hoping that this is easy. my standard drawing tools in a given paper seem to be stuck in some kind of preset isometric drawing. someone knows how to get back to 'normal '. my cursor has a cross and an arrow pointing to the left.

    disable the perspective grid. Shift + ctrl + I

Maybe you are looking for