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;

Tags: Database

Similar Questions

  • PLS-00323: subprogram or cursor...

    Hi all:

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

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

    Header of the original packet:
    PROCEDURE clean_temp_data;

    Original Package body:
    PROCEDURE clean_temp_data
    IS

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

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

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

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

    Thank you
    Andy

    Hello

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

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

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

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

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

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

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

    Concerning
    Peter

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

    Hi all

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

    Please find below the source code.

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

    I tried to compile my drawing

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

    but still

    Select * from user_errors

    Returns

    NAME TYPE SEQUENCE LINE (LINE)

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

    TEXT

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

    ATTRIBUTE MESSAGE_NUMBER

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

    PACKAGE 2 8 12 PKG_PK8842_ACCNOTMOVE BODY

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

    cation and must be defined in the package body

    ERROR 323

    PACKAGE 1 3 12 PKG_PK8842_ACCNOTMOVE BODY

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

    cation and must be defined in the package body

    ERROR 323

    2 selected lines.

    source code:

    CREATE OR REPLACE PACKAGE ZVIT. PKG_PK8842_AccNotMove

    AS

    FUNCTION AccNotMoveJUR)

    p_contragentId dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number;

    FUNCTION AccNotMoveFIZ)

    p_contragentId dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number;

    FUNCTION DtLastMove)

    p_Id B2_OLAP. DIMAACCOUNT_ALL.ID%TYPE)

    Date of RETURN;

    END;

    /

    CREATE OR REPLACE PACKAGE BODY ZVIT. PKG_PK8842_AccNotMove

    AS

    FUNCTION AccNotMoveJUR)

    p_contragentId zvit.dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number

    IS

    l_Result Number (1);

    l_contragentId zvit.dwh_CR_contragent.ID%TYPE;

    l_dateopen Date;

    Date of l_dtMove1;

    Date of l_dtMove2;

    BEGIN

    l_Result: = 0;

    BEGIN

    Select Distinct a.contragentid

    In l_contragentId

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_contragentId: = NULL;

    END;

    IF l_contragentId IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    Select MAX (a.dateopen)

    In l_DateOpen

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and a.ACCOUNTSTATEID <>2

    and a.DateOpen > p_date;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DateOpen: = NULL;

    END;

    IF l_DateOpen IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

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

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTAID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.arcdate > = p_date

    and d.ACCOUNTAID = a.Id

    and d.DOCUMENTTYPEID = dt.id

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

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    l_Result: = 1;

    On the other

    l_Result: = 0;

    End If;

    END IF;

    END IF;

    RETURN l_Result;

    END AccNotMoveJUR;

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

    FUNCTION AccNotMoveFIZ)

    p_contragentId zvit.dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number

    IS

    l_Result Number (1);

    l_contragentId zvit.dwh_CR_contragent.ID%TYPE;

    l_dateopen Date;

    Date of l_dtMove1;

    BEGIN

    l_Result: = 0;

    BEGIN

    Select Distinct a.contragentid

    In l_contragentId

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_contragentId: = NULL;

    END;

    IF l_contragentId IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    Select MAX (a.dateopen)

    In l_DateOpen

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and a.ACCOUNTSTATEID <>2

    and a.DateOpen > p_date;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DateOpen: = NULL;

    END;

    IF l_DateOpen IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.arcdate > = p_date

    and d.ACCOUNTBID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

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

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.ACCOUNTAID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.arcdate > = p_date

    and d.ACCOUNTAID = a.Id

    and d.DOCUMENTTYPEID = dt.id

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

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    l_Result: = 1;

    On the other

    l_Result: = 0;

    End If;

    END IF;

    END IF;

    RETURN l_Result;

    END AccNotMoveFIZ;

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

    FUNCTION DtLastMove)

    p_Id B2_OLAP. DIMAACCOUNT_ALL.ID%TYPE)

    Date of RETURN

    IS

    l_Result Date;

    Date of l_DtLast1;

    Date of l_DtLast2;

    Date of l_DtLast3;

    Date of l_DtLast4;

    BEGIN

    l_Result: = NULL;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast1

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTBID = p_Id

    - and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast1: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast2

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTBID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

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

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast2: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast3

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTAID = p_Id

    and d.DOCUMENTTYPEID = dt.id

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

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast3: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast4

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTAID = p_Id

    and d.DOCUMENTTYPEID = dt.id

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

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast4: = NULL;

    END;

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

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

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

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

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

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

    l_Result: = NULL;

    END IF;

    RETURN l_Result;

    END DtLastMove;

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

    END;

    /

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

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

  • Convert number to Varchar for printing the Type of table in a loop error: PLS-00306:

    Hello

    I am trying to print a number of the Table that I get from a ref cursor But cannot convert the number to Varchar to print. What I'm doing wrong here

    Thank you

    Ken

    OUT_REFCURSOR FETCH BULK COLLECT INTO theTBL_RCRD_ID ;

    So THAT (theTBL_RCRD_ID IS NOT NULL)

    LOOP

    strRCRDID: = TO_CHAR (onTBL_RCRD_ID (indx), "99999");    -This line throws error message

    dbms_output.put_line (strRCRDID);

    INDX: = indx + 1;

    END LOOP;

    • Error: PLS-00306: wrong number or types of arguments in the call to "TO_CHAR.

    Try this...

    strRCRDID: = TO_CHAR (outTBL_RCRD_ID (indx). RCRD_ID, "99999");

  • Error PLS-00801: [phdcsql_print_kge_errors::parm pos] internal error while deploying card OWB

    Any deployment of an existing map of OWB, particularly in an environment (example B), I am facing this error message so that the same code works fine in another environment (say A).

    I tried importing the .mdl to another (A) environment where it works fine, imported in a B environment and attempted to deploy, has always given me same error message all in deployment.

    Help, please.

    Errors of compilation for BODY of PACKAGE *.

    Error: PLS-00801: internal error [phdcsql_print_kge_errors::parm pos]

    Line: 1

    Text: CREATE OR REPLACE PACKAGE BODY "*" AS

    Error: PL/SQL: statement ignored

    Line: 11

    Text: SELECT

    Error: PLS-00801: internal error [phdcsql_print_kge_errors::parm pos]

    Line: 1

    Text: CREATE OR REPLACE PACKAGE BODY 'MAP_DMT_CUST_COMPLAINT_UI' AS

    Error: PL/SQL: statement ignored

    Line: 709

    Text: SELECT

    Error: PLS-00801: internal error [phdcsql_print_kge_errors::parm pos]

    Line: 1

    Text: CREATE OR REPLACE PACKAGE BODY "*" AS

    Error: PL/SQL: statement ignored

    Line: 2332

    Text: MERGE

    Error: ORA-00900: invalid SQL statement

    ORA-00900: invalid SQL statement

    ORA-00900: invalid SQL statement

    Line: 1

    Text: CREATE OR REPLACE PACKAGE BODY "*" AS

    A table was missed and not imported in the OWB repository from which this table was not related. I imported this table, bounded to the search with the table operator and it worked fine.

    Somehow instead of give the real reason, she gave this vague error.

    I hope that this solution works for others :-)

  • Can u explain someone on table mutation error pls...

    Can u explain someone on table mutation error pls...

    Hello

    Explain what, exactly?

    As always, if you get an error, check the manual for Oracle error messages: http://docs.oracle.com/database/121/ERRMG/toc.htm

    Use a search engine to find related sites, such as Tom ask: https://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936

  • SYS. DBMS_SQL. Version of overload of PARSE CLOB error PLS-00172: string literal too long.

    I have This Oracle 12c Procedure

    CREATE OR REPLACE PROCEDURE LOGINCHECK(stmt IN CLOB)
    AS
      C INTEGER
    ;
      N INTEGER
    ;
      RC SYS_REFCURSOR
    ;
    BEGIN
      C
    := SYS.DBMS_SQL.OPEN_CURSOR;
      SYS
    .DBMS_SQL.PARSE(C,stmt,DBMS_SQL.native);
      N
    := SYS.DBMS_SQL.EXECUTE(C);
      SYS
    .DBMS_SQL.GET_NEXT_RESULT(C,RC);
      SYS
    .DBMS_SQL.RETURN_RESULT(RC);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
      
    NULL;
    when OTHERS then
      RAISE
    ;
    END LOGINCHECK;


    for example, to create an oracle with a xml or clob type IN FastInventory procedure and pass xml from this link https://drive.google.com/file/d/0BwAVQqYmX0-zQ1d1VnNmZndfcVE/view?usp=sharing


    The of the stmt parameter is approximately 50000 characters.


    DBMS_SQL. ANALYSIS gives error PLS-00172: string literal too long.


    I'm passing stmt My .net code as parameter . OracleDbType.Clob then why this error occurring.


    I use Oracle 12 c database. Visual Studio 2012, .net Framework 4;

    OK now I have a response team of oracle.net where it says on tweeter

    @OracleDOTNET team .NET oracle

    Seems to be a bug specific to PL/SQL, because the error occurs on the DBMS_SQL. ANALYZE the call

    Thank you all who have helped and at least tried to solve this problem.

  • Please help solve the problem error: PLS-00306: wrong number or types of a

    Hello

    Please see my statement of types and the procedure. Object and the nested table that is declared at the schema level

    I'm using the oracle version 11.2
    CREATE OR REPLACE TYPE T_COPY_EVNT_DTL IS OBJECT
    
    ( 
    
    eventId varchar2(100),
    
    eventDescription varchar2(100),
    
    promoMonthDescription varchar2(100),
    
    promoStartDate varchar2(100),
    
    promoEndDate varchar2(100),
    
    PROMOCOSTSTARTDATE varchar2(100)
    
    );
    
    
    CREATE OR REPLACE TYPE T_EVENT_TABLE IS TABLE OF T_COPY_EVNT_DTL;
    
    create or replace PROCEDURE Pr_Event_Details_new(ip_xml          CLOB,
                                                                                                                                                     op_sections_xml OUT XMLTYPE) AS
         
         event_list     t_copy_evnt_dtl;
         event_data_sec t_event_table := t_event_table();
         
         
         CURSOR get_event_cur IS
              SELECT cast(collect(t_copy_evnt_dtl(evnt.event,                                                                                                                    evnt.event_desc,
                        mth.promo_month_desc,
                        TO_CHAR(evnt.start_date,
                        'DD/MM/YYYY'),
                        TO_CHAR(evnt.end_date,
                        'DD/MM/YYYY'),
                        TO_CHAR((evnt.start_date - 21),
                        'DD/MM/YYYY'))) as
                        t_event_table)
                   FROM RETEK_PROMO_EVENT_MST evnt
               INNER JOIN  .....
               WHERE ... 
               ORDER BY evnt.event_desc,
                                       mth.promo_month_desc,
                                       dtl.promo_start_date,
                                       dtl.promo_end_date,
                                       dtl.promo_cost_start_date;
    
         type get_event_tab is table of get_event_cur%rowtype index by Binary_Integer;
         l_get_event_tab get_event_tab;
    BEGIN
    
         ....
         
         
              OPEN get_event_cur;
              fetch get_event_cur
                   into event_data_sec;
         
              event_data_sec := set(event_data_sec);
              ...
              
              
              
    EXCEPTION
              --log_errors...                                                                 
              Raise;
    END Pr_Event_Details_new;
    Error: PLS-00306: wrong number or types of arguments in the call to 'SET '.
    Online: 117
    Text: event_data_sec: = set (event_data_sec);

    Error: PL/SQL: statement ignored
    Online: 117
    Text: event_data_sec: = set (event_data_sec);

    You will raise a wrong number or types of argument error, or an exception of PLS-00306, if you use the fixed operator with the collection of user-defined object types.

    The collection must contain SQL scalar data types - single values without internal components...

    Numeric values, on which you can perform arithmetic operations.
    Alphanumeric values that represent individual or strings of characters, characters that you can manipulate.
    Logical values, on which you can perform logical operations.
    Dates and times, you can manipulate.
    Time intervals, you can handle.

    Published by: stefan nebesnak on January 24, 2013 13:22

  • Why I got error PLS-00103 for this procedure?

    Hey, guys:

    I have a question about the syntax of the exception, I want to record the number of rows from the tables, but if there is no such thing as a table, my program must be able to continue the loop.
    create or replace procedure check_rows as
    
    
       cursor t1 is select table_name from all_csv
                 where table_built='Y'
                 and table_name is not null;
    
      match_count1 INTEGER;
      
    begin
    
       for n in t1 loop
       
          dbms_output.put_line(n.table_name);
          EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || n.table_name INTO match_count1 ;
    
          
          update all_csv
          set total_rows=match_count1
          where table_name=n.table_name;
          
          exception when table_does_not_exist then null end;  
    
       end loop;
       
       commit;
    
    end;
    I'm your only syntax error:


    PLS-00103: encountered the symbol "EXCEPTION" when expected
    of the following:
    begin case declare end exit for goto if loop mod null pragma
    raise return select update while < ID >
    < between double quote delimited identifiers of > < a variable binding > < <
    Close current delete fetch locking insert open rollback
    SAVEPOINT SQLExecute set pipe fusion commit forall

    Could someone give me a hint?

    Thank you very much!

    Sam

    EXCEPTION clause should be at the end of the BEGIN block. It cannot start in the middle of the lock begin body:

    create or replace
      procedure check_rows
        as
            cursor t1
              is
                select  table_name
                  from  all_csv
                  where table_built='Y'
                    and table_name is not null;
            match_count1 INTEGER;
        begin
            for n in t1 loop
              begin
                  dbms_output.put_line(n.table_name);
                  EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || n.table_name INTO match_count1;
                  update  all_csv
                     set  total_rows = match_count1
                    where table_name = n.table_name;
                exception
                  when table_does_not_exist then null;
              end;
            end loop;
       commit;
    end;
    /
    

    And it is not a good idea to engage in the stored procedure. But the main question here is table_does_not_exist exception because it is not declared in your code. You must declare it and use PRAGMA EXCEPTION_INIT to connect with the desired error code.

    SY.

  • I am receving oracle error PLS-00201

    Hi all
    When I call a procedure stored beside another stored procedure I get the below error

    PLS-00201: identifier 'P_IN_USER_NAME' must be declared.

    CREATE OR REPLACE PACKAGE BODY VABOSS. VABOSS_ODM_CHNG_PKG
    AS
    PROCEDURE VABOSS_DEL_UPL_CHNG (P_IN_UPD_NO IN VARCHAR2, P_IN_RELEASE IN P_IN_RECREATE IN P_IN_USER IN VARCHAR2, BOOLEAN, BOOLEAN)
    IS
    /*******************************************************************************************************************
    Module name: VABOSS data, delete and insert
    Package Name: VABOSS_ODM_CHNG_PKG
    Program name: VABOSS_DEL_UPL_CHNG
    Program description: this processing of drop table VABOSS_PLAN_ODM_BOM and insertion of data in the VABOSS_PLAN_ODM_BOM.
    Created by: Maria - touati
    Creation date: 14 October 2011
    PROJECT_NAME: VABOSS
    First version: 1.0
    Input parameters: all THE
    Output parameters: no
    Return the parameters: no
    ********************************************************************************************************************/
    CURSOR C_DEL
    IS
    SELECT GENERATION_ID, ODM_BOM_ID
    OF VABOSS_PLAN_ODM_BOM
    WHERE GENERATION_ID IN (SELECT GENERATION_ID
    OF VABOSS_PLAN_ODM_UPDATE_ADMIN
    WHERE UPD_NO = P_IN_UPD_NO);

    CURSOR C_INST
    IS
    SELECT *.
    OF VABOSS_INTR_ODM_BOM
    WHERE ODM_BOM_ID IN SELECT (SEPARATE ODM_BOM_ID
    Of
    ADELINE VABOSS_PLAN_ODM_UPDATE_ADMIN
    WHERE PUAH. UPD_NO = P_IN_UPD_NO;)

    CURSOR C_UPD
    IS
    SELECT *.
    OF VABOSS_PLAN_ODM_BOM_FILE
    WHERE ODM_BOM_ID IN SELECT (SEPARATE ODM_BOM_ID
    Of
    ADELINE VABOSS_PLAN_ODM_UPDATE_ADMIN
    WHERE PUAH. UPD_NO = P_IN_UPD_NO;)


    V_UPD_NO VARCHAR2 (15);
    V_ERROR_MSG VARCHAR2 (20);
    NUMBER OF V_INS_CNT;

    BEGIN

    FOR T_UPD_NO IN C_DEL
    LOOP

    BEGIN

    REMOVE FROM VABOSS_PLAN_ODM_BOM
    WHERE GENERATION_ID = T_UPD_NO. GENERATION_ID;

    UPDATE VABOSS_PLAN_ODM_BOM_FILE
    SET CURRENT_STATUS = '99'
    WHERE ODM_BOM_ID = T_UPD_NO. ODM_BOM_ID;
    COMMIT;

    EXCEPTION
    WHILE OTHERS
    THEN
    VABOSS_COMMON_PKG.oracle_error_info (SQLCODE,
    SQLERRM,
    ' VABOSS_ODM_CHNG_PKG. VABOSS_DEL_UPL_CHNG',.
    p_in_user);
    END;

    END LOOP;

    FOR T_INST_NO IN C_INST
    LOOP
    BEGIN

    INSERT INTO VABOSS_PLAN_ODM_BOM (GRT_SEQ_NO,
    ODM_BOM_ID,
    SEQ_NO,
    STATUS,
    AGENDA,
    BLOCK_ID,
    BLOCK_NAME,
    SPEC_CATEGORY_ID,
    SPEC_CATEGORY_NAME,
    SPEC_ID,
    SPEC_NAME,
    LEVEL_01,
    LEVEL_02,
    LEVEL_03,
    LEVEL_04,
    LEVEL_05,
    LEVEL_06,
    LEVEL_07,
    LEVEL_08,
    LEVEL_09,
    MODULE_ID,
    MODULE_NAME,
    SONY_ASSY_NUMBER,
    LOCAL_PARTS_NUMBER,
    LOCAL_PARTS_NAME,
    SONY_MP_PARTS_NUMBER,
    SONY_SERVICE_PARTS_NUMBER,
    SONY_SERVICE_PARTS_NAME,
    PARTS_QUANTITY,
    SERVICE,
    SUBSTITUTE,
    SERVICE_MANUAL_REF,
    CRP,
    SAFETY_PART,
    ELECTRONIC_KEY_PART,
    PROVISION,
    ACL_TYPE,
    $VENDOR_NAME,
    VENDOR_DESCRIPTION,
    GENERATION_ID,
    PROTOTYPE_MODEL_NUMBER,
    REMARKS1,
    REMARKS2,
    SERVICE_MANUAL_REMARK1,
    SERVICE_MANUAL_REMARK2,
    EFFECTIVE_START_DATE,
    EFFECTIVE_END_DATE,
    TECHNICAL_NEWS,
    CREATE_USER,
    CREATE_DATE,
    MODULE_A_NO,
    COMBINATION_PARTS,
    EXPLOSION_CODE_FOR_SERVICE,
    SERVICE_MANUAL_BLOCK,
    SUBSTITUTE_PART_INFO,
    USER_ADD_FLAG
    )
    VALUES (VB_PLAN_ODM_BOM_SEQ. NEXTVAL,
    T_INST_NO. ODM_BOM_ID,
    T_INST_NO. SEQ_NO,
    '00',
    T_INST_NO. AGENDA,
    T_INST_NO. BLOCK_ID,
    T_INST_NO. BLOCK_NAME,
    T_INST_NO. SPEC_CATEGORY_ID,
    T_INST_NO. SPEC_CATEGORY_NAME,
    T_INST_NO. SPEC_ID,
    T_INST_NO. SPEC_NAME,
    T_INST_NO. LEVEL_01,
    T_INST_NO. LEVEL_02,
    T_INST_NO. LEVEL_03,
    T_INST_NO. LEVEL_04,
    T_INST_NO. LEVEL_05,
    T_INST_NO. LEVEL_06,
    T_INST_NO. LEVEL_07,
    T_INST_NO. LEVEL_08,
    T_INST_NO. LEVEL_09,
    T_INST_NO. MODULE_ID,
    T_INST_NO. MODULE_NAME,
    T_INST_NO. SONY_ASSY_NUMBER,
    T_INST_NO. LOCAL_PARTS_NUMBER,
    T_INST_NO. LOCAL_PARTS_NAME,
    T_INST_NO. SONY_MP_PARTS_NUMBER,
    T_INST_NO. SONY_SERVICE_PARTS_NUMBER,
    T_INST_NO. SONY_SERVICE_PARTS_NAME,
    T_INST_NO. PARTS_QUANTITY,
    T_INST_NO. SERVICE,
    T_INST_NO. SUBSTITUTE,
    T_INST_NO. SERVICE_MANUAL_REF,
    T_INST_NO. CRP,
    T_INST_NO. SAFETY_PART,
    T_INST_NO. ELECTRONIC_KEY_PART,
    T_INST_NO. PROVISION,
    T_INST_NO. ACL_TYPE,
    T_INST_NO. $VENDOR_NAME,
    T_INST_NO. VENDOR_DESCRIPTION,
    T_INST_NO. GENERATION_ID,
    T_INST_NO. PROTOTYPE_MODEL_NUMBER,
    T_INST_NO. REMARKS1,
    T_INST_NO. REMARKS2,
    T_INST_NO. SERVICE_MANUAL_REMARK1,
    T_INST_NO. SERVICE_MANUAL_REMARK2,
    T_INST_NO. EFFECTIVE_START_DATE,
    T_INST_NO. EFFECTIVE_END_DATE,
    NULL,
    p_in_user,
    VABOSS_COMMON_PKG. TIMEZONE_CONVERSION_TO_JST,
    T_INST_NO. MODULE_A_NO,
    T_INST_NO.COMBINATION_PARTS,
    T_INST_NO. EXPLOSION_CODE_FOR_SERVICE,
    T_INST_NO. SERVICE_MANUAL_BLOCK,
    T_INST_NO. SUBSTITUTE_PART_INFO,
    T_INST_NO. USER_ADD_FLAG
    );

    v_ins_cnt: = v_ins_cnt + sql % ROWCOUNT;

    IF MOD (v_ins_cnt, 500) = 0
    THEN
    COMMIT;
    END IF;


    EXCEPTION
    WHILE OTHERS
    THEN

    VABOSS_COMMON_PKG.oracle_error_info (SQLCODE,
    SQLERRM,
    ' VABOSS_ODM_CHNG_PKG. VABOSS_DEL_UPL_CHNG',.
    p_in_user);
    END;

    END LOOP;

    FOR T_UPD_FILE IN C_UPD
    LOOP

    BEGIN

    UPDATE VABOSS_PLAN_ODM_BOM_FILE
    SET CURRENT_STATUS = '90',
    UPDATE_USER = P_IN_USER,
    UPDATE_DATE = VABOSS_COMMON_PKG. TIMEZONE_CONVERSION_TO_JST
    WHERE ODM_BOM_ID = T_UPD_FILE. ODM_BOM_ID;
    EXCEPTION
    WHILE OTHERS
    THEN
    VABOSS_COMMON_PKG.oracle_error_info (SQLCODE,
    SQLERRM,
    ' VABOSS_ODM_CHNG_PKG. VABOSS_DEL_UPL_CHNG',.
    p_in_user);
    END;

    END LOOP;

    -VALIDATION;

    -IMMEDIATE EXECUTION "VABOSS_INTR_ODM_BOM";

    FOR T_DEL_INTR IN C_DEL

    LOOP

    BEGIN

    DELETE
    OF VABOSS_INTR_ODM_BOM
    WHERE ODM_BOM_ID = T_DEL_INTR. ODM_BOM_ID;

    UPDATE VABOSS_PLAN_ODM_BOM
    SET STATUS = '99',
    UPDATE_USER = P_IN_USER,
    UPDATE_DATE = VABOSS_COMMON_PKG. TIMEZONE_CONVERSION_TO_JST
    WHERE ODM_BOM_ID = T_DEL_INTR. ODM_BOM_ID;
    COMMIT;

    EXCEPTION
    WHILE OTHERS
    THEN

    VABOSS_COMMON_PKG.oracle_error_info (SQLCODE,
    SQLERRM,
    ' VABOSS_ODM_CHNG_PKG. VABOSS_DEL_UPL_CHNG',.
    p_in_user);

    END;

    END LOOP;

    / * Calls a procedure SERVICE_PARTS_LIST_RELEASE_ODM * /.

    VABOSS_SERVICE_BOM_PKG. SERVICE_PARTS_LIST_RELEASE_ODM-> >HERE I am GETTING the ERROR
    (P_IN_UPD_NO,
    P_IN_USER_NAME);

    EXCEPTION
    WHILE OTHERS
    THEN

    VABOSS_COMMON_PKG.oracle_error_info (SQLCODE,
    SQLERRM,
    ' VABOSS_ODM_CHNG_PKG. VABOSS_DEL_UPL_CHNG',.
    p_in_user);

    END VABOSS_DEL_UPL_CHNG;





    END VABOSS_ODM_CHNG_PKG;
    /


    your help is apprecited

    Thank you
    Krupa

    879534 wrote:
    PLS-00201: identifier 'P_IN_USER_NAME' must be declared.

    CREATE OR REPLACE PACKAGE BODY VABOSS. VABOSS_ODM_CHNG_PKG
    AS
    PROCEDURE VABOSS_DEL_UPL_CHNG (P_IN_UPD_NO IN VARCHAR2, IN BOOLEAN P_IN_RECREATE, IN BOOLEAN P_IN_RELEASE, * P_IN_USER * IN VARCHAR2)

    ... snip...

    VABOSS_SERVICE_BOM_PKG. SERVICE_PARTS_LIST_RELEASE_ODM---> >HERE I am GETTING the ERROR
    (P_IN_UPD_NO,
    ( P_IN_USER_NAME ) ;

    Spot the difference

  • Error PLS-00103 and the program has stopped responding

    Hey all, I am currently practical with pl/sql, I am a beginner trying to pl/sql self-training, I use the HR schema that accompanies the express edition of oracle 10g for practice, here is my code:

    -- -------------------------------------------------------------------------------------------
    FUNCTION to CREATE or REPLACE checkIfSalaryExceedMin (currentJobID in NUMBER, currentProposedSalary number)
    RETURN BOOLEAN IS

    minSalary NUMBER: = 0;

    Begin

    Select j.min_salary FROM minSalary of JOB j where j.job_id = currentJobID;

    RETURN currentProposedSalary > minSalary;

    End checkIfSalaryExceedMin;
    -- -------------------------------------------------------------------------------------------
    -- -------------------------------------------------------------------------------------------
    FUNCTION to CREATE or REPLACE checkForJobChange (currentEmpID in NUMBER, currentEmpStartDate IN DATE)
    RETURN BOOLEAN IS

    CURSOR emp_date_id_list1 IS (Select j1.start_date, e1.employee_id JOB_HISTORY j1 EMPLOYEES JOIN e1 ON j1.employee_id = e1.employee_id);

    checkVal NUMBER: = 0;

    Begin

    For em1 IN LOOP emp_date_id_list1

    IF (currentEmpID = em1.employee_id AND currentEmpStartDate! = em1.start_date) THEN
    checkVal: = 1;
    END IF;

    END LOOP;

    IF checkVal = 1 THEN
    RETURN TRUE;
    ELSIF checkVal = 0 THEN
    RETURN FALSE;
    END IF;

    End checkForJobChange;
    -- -------------------------------------------------------------------------------------------
    -- ===================MAIN====================
    Declare

    CURSOR emp_date_id_list IS (Select j.start_date, e.employee_id, e.job_id, e.salary JOB_HISTORY e j EMPLOYEES JOIN ON j.employee_id = e.employee_id);

    Begin

    For em IN emp_date_id_list LOOP

    IF (em.start_date < TO_DATE ('1990-01-01', 'YYYY-MM-DD')) THEN

    IF (checkForJobChange (em.employee_id, em.start_date)) THEN
    IF checkIfSalaryExceedMin (em.job_id, (e.salary + (e.salary*.20))) THEN
    DBMS_OUTPUT. Put_line ('you can increase his salary');
    END IF;
    END IF;

    END IF;

    END LOOP;

    End;

    -- ================END==MAIN==================

    What it does is check if the employee worked prior to January 1, 1990, if he had had a change of job and if it fulfills the two conditions, the program checks if its proposed new salary will be larger than his salary manager current, if not he can get a pay raise.

    So my problem is I got an error PLS-00103 earlier, after some tweaking my program now is insensitive, what am I doing wrong? :(

    Help, please. Thank you.

    checkIfSalaryExceedMin (currentJobID in NUMBER

    Must be:

    checkIfSalaryExceedMin (currentJobID in VARCHAR2

    or:

    checkIfSalaryExceedMin (currentJobID IN employees.job_id%type

    Since then job_id is of data type VARCHAR2 and not a NUMBER.

    Also

    IF checkIfSalaryExceedMin (em.job_id, (e.salary + (e.salary*.20))) THEN

    must be:

    IF checkIfSalaryExceedMin (em.job_id, (em.salary + (em.salary*.20))) THEN

    After some tweaking my program does not

    I've been juggling as well and are unaware of any 'unresponsiveness':

    SQL> declare
      2    cursor emp_date_id_list
      3    is
      4    select j.start_date
      5    ,      e.employee_id
      6    ,      e.job_id
      7    ,      e.salary
      8    from job_history j
      9    join employees e
     10    on j.employee_id = e.employee_id;
     11  begin
     12    for em in emp_date_id_list
     13    loop
     14      if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD'))
     15      then
     16        if (checkforjobchange(em.employee_id, em.start_date))
     17        then
     18          if checkifsalaryexceedmin(em.job_id, (e.salary + (e.salary * .20)))
     19          then
     20            dbms_output.put_line('You can raise his salary');
     21          end if;
     22        end if;
     23      end if;
     24    end loop;
     25  end;
     26  /
            if checkifsalaryexceedmin(em.job_id, (e.salary + (e.salary * .20)))
                                                  *
    ERROR at line 18:
    ORA-06550: line 18, column 47:
    PLS-00201: identifier 'E.SALARY' must be declared
    ORA-06550: line 18, column 9:
    PL/SQL: Statement ignored
    
    SQL> declare
      2    cursor emp_date_id_list
      3    is
      4    select j.start_date
      5    ,      e.employee_id
      6    ,      e.job_id
      7    ,      e.salary
      8    from job_history j
      9    join employees e
     10    on j.employee_id = e.employee_id;
     11  begin
     12    for em in emp_date_id_list
     13    loop
     14      if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD'))
     15      then
     16        if (checkforjobchange(em.employee_id, em.start_date))
     17        then
     18          if checkifsalaryexceedmin(em.job_id, (em.salary + (em.salary * .20)))
     19          then
     20            dbms_output.put_line('You can raise his salary');
     21          end if;
     22        end if;
     23      end if;
     24    end loop;
     25  end;
     26  /
    declare
    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 18
    
    SQL> create or replace function checkifsalaryexceedmin(currentjobid          in employees.job_id%typ
    e
      2                                                   ,currentproposedsalary in number)
      3   return boolean is
      4
      5   minsalary number := 0;
      6
      7  begin
      8
      9   select j.min_salary
     10     into minsalary
     11     from jobs j
     12    where j.job_id = currentjobid;
     13
     14   return currentproposedsalary > minsalary;
     15
     16  end checkifsalaryexceedmin;
     17  /
    
    Function created.
    
    SQL> declare
      2    cursor emp_date_id_list
      3    is
      4    select j.start_date
      5    ,      e.employee_id
      6    ,      e.job_id
      7    ,      e.salary
      8    from job_history j
      9    join employees e
     10    on j.employee_id = e.employee_id;
     11  begin
     12    for em in emp_date_id_list
     13    loop
     14      if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD'))
     15      then
     16        if (checkforjobchange(em.employee_id, em.start_date))
     17        then
     18          if checkifsalaryexceedmin(em.job_id, (em.salary + (em.salary * .20)))
     19          then
     20            dbms_output.put_line('You can raise his salary');
     21          end if;
     22        end if;
     23      end if;
     24    end loop;
     25  end;
     26  /
    You can raise his salary
    You can raise his salary
    
    PL/SQL procedure successfully completed.
    
  • package with error pls-00103.

    Hello all;

    I was wondering if you can help me understand why I get an error pls-003. Also, how you include a blank space in a where in the statement. Thanks for the help
    Something similar to this where in ('  ')
    See the package below
    create or replace package NEW_INFORMATION is
    
    
    function total_number return number;
    procedure daily_tasks;
    
    
    
    
      
    end NEW_INFORMATION;
    See the below package body
    create or replace package body NEW_INFORMATION  is
    -----------------------------------------------------------------------------------------------------
    function total_number return number is
    
    oput number(10);
    
    begin
    
      select count(unique (p1.user_id)) into oput
      from table_one p1 where p1.user_id in 
        ('JOHN', 'PAIR', '      ');
    
     return oput;
    end; 
    -----------------------------------------------------------------------------------------------------
    
    
    procedure daily_tasks is
      
    name_p_id varchar2(20);
    temp_num number(6,2);
    
    temp_num :=  total_number(); --used to call the above function 
    
    
    begin
      
    
    end daily_tasks ;
    end NEW_INFORMATION;

    Hello

    Whenever you have a question about an error message, it helps if you post the full error message, including line numbers.

    In the package body, you must:

    procedure daily_tasks is
    
         name_p_id     varchar2(20);
         temp_num      number(6,2);
    
         temp_num :=  total_number(); --used to call the above function 
    
    begin
    ...
    

    The statement

         temp_num :=  total_number(); --used to call the above function 
    

    would be good after the BEGIN statement, but not in front of him, in the declaration section.
    If you declare and initialize temp_num at the same time, you can say:

    temp_num   number (6,2) := total_number;
    

    Given that you call total_number without argument, the parnetheses are optional.

    The condition

    where p1.user_id in  ('JOHN', 'PAIR', '      ');
    

    is syntactically correct. It will result in the rows being counted when user_id is one of the following:
    (a) the 4 characters strring 'J', 'o', 'H', ' don't
    (b) the 4 characters strring 'P', 'A', 'I', 'R', or
    (c) the 6-character string '',' ', ' ', ' ', '',' ' (in other words, 6 characters)

    If this isn't what you want, post a small example of data for table_one (CREATE TABLE and INSERT statements) and the results desired from these sample data.

  • Get the error PLS-00103 while specifying the Type of package

    Hey bud,
    All by specifying a Type which is the table of a different type, in the same package, I get an error in my PL Sql Developer, saying:


    Errors of compilation for the OASIS_TST PACKAGE. PK_OA
    Error: PLS-00103: encountered the symbol "TABLE" when awaits one of the following values:
    opaque object
    Line: 61
    Text: as a table of tp_report;

    Here are the specs of my package where the respective Types are declared:

    ************************************************************************
    create or replace package pk_oa
    is
    function (report)
    as in pd_date)
    return tp_tab in pipeline;

    type tp_report
    as an object
    *(*
    ID INT,
    last_nm VARCHAR2 (50).
    first_nm VARCHAR2 (50).
    full_nm VARCHAR2 (50));

    type tp_tab
    as the table of tp_report;

    end;
    **************************************************************
    Could you find where I'm wrong with this piece.
    Thank you

    HP

    You must create types of objects outside packages:

    SQL> create or replace type tp_report
      2  as object(
      3     id INT,
      4     last_nm VARCHAR2(50),
      5     first_nm VARCHAR2(50),
      6     full_nm VARCHAR2(50));
      7  /
    
    Typ wurde erstellt.
    
    SQL> create or replace package pk_oa
      2  is
      3
      4  type tp_tab
      5  is table of tp_report;
      6
      7  function report (
      8  pd_date in date)
      9  return tp_tab pipelined;
     10
     11  end;
     12  /
    
    Package wurde erstellt.
    

    URS

  • Trigger error pls-00103

    Hey guys,.
    trying to create a trigger, but I'm getting the error pls-00103 I can't seem to find whats wrong
    can someone help with this at all?

    CREATE OR REPLACE the TRIGGER 'shop_closed_check '.
    before insertion or update of current_status on the shop
    Start
    for each line

    If: new.current_status! = ' 4 - CLOSED"and: old.current_status = '4' - CLOSED
    RAISE_APPLICATION_ERROR ("NUM = >-20000, msg = > ' cannot reopen a closed call");
    on the other
    null;

    end if;
    end shop_closed_check;

    Thanks in advance :)

    Published by: Sally188 on December 7, 2009 06:45

    Try this - no need for quotes for the name of the trigger and for each line won't come before
    If should have one then

    create or replace trigger shop_closed_check
    before insert or update of current_status on shop
    for each row
    begin
    
    if :old.current_status = '4 - CLOSED' then
    RAISE_APPLICATION_ERROR(NUM=>-20000, msg=>'cannot reopen a closed call');
    else
    null;
    
    end if;
    end shop_closed_check;
    

Maybe you are looking for

  • B1H40EA #UUW: cannot install Windows 10 USB and Windows 7 online

    Presario CQ57-400SO. I can't install Windows 10 from both usb and online.i once finished the installation process of void and he returned my system to the old program Windows 7

  • How can I find out how many titles I have in iTunes?

    Hello In previous editions of iTunes, there was information at the bottom indicating something like-470 items, 1.1 days, 2.96 GB. I have can´t see it now. How to get this info? Thank you

  • Photosmart B 209 sees more WIFI network since I moved from WEP to WPA

    My HP Photosmart worked fine until my ISP asked me to change the name of my WIRELESS network (which now includes the symbols underscore) and the type of protection increased from WEP to WPA... Paswword has not changed, it's just the type of protectio

  • What is VPN works with broad public IP address?

    Hello If I use the public broad IP (for example 100.100.x.x) for my business network, and I intend to use VPN to connect to my remote desktop. Which will display a problem? Will it be any impact? My concern is that I could send Cliaa IP addresses of

  • photos of e-mail to win 8 Photo Viewer

    How can I e-mail a picture of windows photo viewer 8, the message says that I need to create an association. I don't want to use skydrive to do what I don't want to upload my pictures anywhere.  Thank you all