PLS-00364 error

Hi,
I create this anonymous block:
Declare
errcode number;
errmsg CHAR(300);
v_ticket_no o2b_ai_ese_int1.ticket_no%type;
v_EXTERNAL_ID o2b_ai_ese_int1.EXTERNAL_ID%type;
v_ACCOUNT_NO o2b_ai_ese_int1.ACCOUNT_NO%type;
v_SUBSCR_NO o2b_ai_ese_int1.subscr_no%type;
v_data_inizio date;
v_data_fine date;
v_data_start_linea date;
v_data_fine_linea date;
v_data_start_acct date;
v_data_fine_acct date;
V_row_id varchar2(09) ;
V_CUSTOMER char(30);
v_bonifica          o2b_ai_ese_out.bonifica%type;
v_select VARCHAR2(5000):='';
v_select2 VARCHAR2(5000):='';
ctr_letti number(3);
ctr_scritti number(3);
ctr_scartati number(3);
ctr_ricevuta number(3);
ctr_errore number(3);
ctr_sga number(3);
ctr_siebel number(3);
cursor curlinea1 is
select stato,stato2
FROM siebel.s_quote_soln@DBSIEBEL a, o2b_ai_ese_in b
WHERE a.asset_num = b.linea;
cursor curlinea2 is
select stato,stato1,stato2
FROM siebel.s_quote_soln@DBSIEBEL a,
siebel.s_org_ext@DBSIEBEL b,
siebel.s_org_indust@DBSIEBEL c, o2b_ai_ese_in d
WHERE a.x_org_ext_id = b.row_id
and b.row_id = c.ou_id
and a.asset_num = d.b.linea;
BEGIN
dbms_output.put_line( 'Inizio');
ctr_letti:=0;
ctr_scritti:=0;
ctr_scartati:=0;
ctr_ricevuta:=0;
ctr_errore:=0;
ctr_sga:=0;
ctr_siebel:=0;
V_row_id:=0;
For ind_tab1 in curlinea1
loop
     if ind_tab1.stato='RICEVUTA' OR ind_tab1.stato='RICEVUTA BDA' then
     ctr_ricevuta:=ctr_ricevuta+1;
     else
     if ind_tab1.stato2='IN ERRORE' then
     ctr_errore:=ctr_errore+1;
     v_select:='';
v_select:='select pbs_serv_vs_linea_data_inizio,pbs_serv_vs_linea_data_fine' ||
'from pbs01.pbs_serv_vs_linea@'||trim(V_CUSTOMER) ||
'where pbs_serv_vs_linea_subscr_no = '''||v_SUBSCR_NO||''''||
          'and pbs_serv_vs_acct_contratto=''' || 'A1''';
               dbms_output.put_line( 'Inizio');
EXECUTE IMMEDIATE v_select into v_data_start_linea,v_data_fine_linea;
     v_select2:='';
v_select2:='select pbs_serv_vs_acct_data_inizio,pbs_serv_vs_acct_data_fine' ||
'from pbs01.pbs_serv_vs_acct@'||trim(V_CUSTOMER) ||
'where pbs_serv_vs_acct_ac_no_agg = '''||v_ACCOUNT_NO||''''||
          'and pbs_serv_vs_acct_contratto=''' || 'A0''';
EXECUTE IMMEDIATE v_select2 into v_data_start_acct,v_data_fine_acct;
     exit;
     end if;
     end if;
     ctr_letti:=ctr_letti+1;
     end loop;
     DBMS_OUTPUT.PUT_LINE( 'dopo loop');
IF ctr_errore = 0 then
For ind_tab2 in curlinea2
loop
if (ind_tab2.stato='RICEVUTA' OR ind_tab2.stato='ERRORE' OR ind_tab2.stato='' ) AND
(ind_tab2.stato2='' OR ind_tab2.stato2='INVIARE')
     then
     ctr_siebel:=ctr_siebel+1;
     end if;
     if (ind_tab2.stato='IN PARCHEGGIO FATT' OR ind_tab2.stato='') AND
(ind_tab2.stato1='IN ATTESA RESP' OR ind_tab2.stato1='NO ACTION')
     then
     ctr_sga:=ctr_sga+1;
     exit;
     end if;
     end loop;
IF ctr_sga > 0 then
v_bonifica:='assegnato a SGA-EF';
else
v_bonifica:='assegnato a Siebel';
end if;
END IF;
EXCEPTION
WHEN OTHERS THEN
errcode:=SQLCODE;
errmsg:=SUBSTR(SQLERRM,1,300);
ROLLBACK;
RAISE_APPLICATION_ERROR(-20033,'Errore = '||errcode||errmsg);
END;
bur when I run I get this error:
PLS-00364: loop index variable 'IND_TAB2' use is invalid
the for loop seem correct.
Have someone any idea for this error?

why I must declare ind_tab2 ?You don't.
OR ind_tab2.stato='' will never evaluate to TRUE, you need to use "is null"
I don't know why you are getting the error though, as you don't have any out parameters

Similar Messages

  • PLS-00907 Error but referenced package compiled

    Hi I am experiencing some problems with Database Link.
    In DEV Environment,
    I have two database, DB A and DB B.
    In DB A I have package name SUPPORT_PKG and inside it I have a function named HISTORY_UPDATE.
    Package is compiled correctly in DB A and working fine.
    I created a procedure CALL_HIST_UPD in DB B to execute SUPPORT.PKG.HISTORY_UPDATE@A through DB LINK.
    and it gave me PLS-00907 error.
    UAT environment has the same setup of user and package as DEV.
    then I tried to copy the CALL_HIST_UPD to DB B in UAT and it can be compiled sucessfully in UAT.so I do the following
    Back to Dev again
    I tried to figure what's going on until I decided to replace the header specification SUPPORT.PKG.HISTORY_UPDATE
    with the declaration part from the body and recompiled the whole package again, and this time I can compile the procedure in DB B.
    I am curious and check the header in UAT and found that UAT Headers is the same exactly with the DEV Headers
    before I replaced it with the new one by copying from the body. I am curious why the DEV environment give the PLS-00907 error at the first time, even at that time package in A are compiled nicely.
    Let me know if the question is not clear.
    thanks for your help

    Try this -
    CREATE OR REPLACE PACKAGE data_mgmt AUTHID CURRENT_USER
    IS
       FUNCTION hy_name (in_dt DATE, in_option_txt VARCHAR2)
          RETURN VARCHAR2;
    END data_mgmt;
    CREATE OR REPLACE PACKAGE BODY data_mgmt
    IS
       FUNCTION hy_name (in_dt DATE, in_option_txt VARCHAR2)
          RETURN VARCHAR2
       IS
          return_txt   VARCHAR2 (25);
       BEGIN
          RETURN return_txt;
       END hy_name;
    END data_mgmt;
    /

  • Getting pls-00428 error.

    Hi all,
    I'm trying to fix some invalid objects in our 11g database and i'm getting a pls-00428 error. Not sure where the issue is originating at (keep in mind, my IT team and I are not thoroughly experienced with 11g, so I apologize if this sounds a little too newbie-ish)
    Here's the plsql:
    create or replace
    FUNCTION detail_cogs (
         sSKU varchar2
         --,dtFrom date := sysdate
    return number
    is
         nRetval number;
    begin
    select *
    --SUM(cost * ieqty) into nRetval
    from (
    select
    ie.qty ieqty
    ,ie.part
    ,ic.validdate
    ,ic.cost
    ,LAG(validdate) OVER (partition by ic.part order by validdate desc) prev_entry_time
    from
    oracle2_partexplosion_mv ie
    ,oracle2_itemcogs_mv ic
    where
    ie.sku = sSKU
    and ic.part = ie.part
    and ic.validdate <= sysdate
    order by part, validdate desc
    where
    prev_entry_time is null;
         return nRetval;
    exception
         when others then
              return null;
    end;

    Welcome to the forum.
    Reading the documentation will save you:
    PLS-00428: an INTO clause is expected in this SELECT statement
    Cause: The INTO clause of a SELECT INTO statement was omitted. For example, the code might look like SELECT deptno, dname, loc FROM dept WHERE ... instead of SELECT deptno, dname, loc INTO dept_rec FROM dept WHERE ... In PL/SQL, only a subquery is written without an INTO clause.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10880/pcmus.htm#sthref17855
    http://www.oracle.com/pls/db112/search?word=select+into&partno=e10472
    Doc home: http://www.oracle.com/pls/db112/homepage
    And please change or remove this part from your code anyway, since it's nothing but a bug:
    exception
    when others then
    return null;11g compiler warned you already about that, I may hope...

  • PLS-00428 Error when creating a new trigger

    Hi,
    I'm encountering the PLS-00428 error when I run the script below.
    CREATE OR REPLACE TRIGGER TIBCOUSER.po_response_trigger
    BEFORE INSERT ON po_response FOR EACH ROW
    BEGIN
    IF:NEW.ariba_processsequence is null then
    SELECT pttransid AS pttransid, 'Product Test Pass 1' AS pttransname, aribaorderid AS aribaorderid, '0' AS errorcode, '' AS MESSAGE, SYSDATE AS ariba_insertdate
    FROM po_request
    WHERE adb_l_delivery_status = 'N';
    UPDATE po_request
    SET adb_l_delivery_status = 'C'
    WHERE adb_l_delivery_status = 'N';
    END IF;
    END;
    Can someone point out what is missing or what is wrong with the script? Any help would be much appreciated.
    Regards,
    Jigger

    Hi Jigger,
    I was able to create the trigger using the script below.That's nice, you got the trigger created. Below is your trigger, I have added some comments.
    create or replace trigger tibcouser.po_response_trigger
       before insert or update
       on po_response
       for each row
    declare
      -- 1. These variables should really be anchored to po_response
      -- 2. They should be named differently than columns in po_response
      -- 3. It seems that you don't need them (See 7.)
       pttransid               integer := null;
       pttransname             varchar2(255) := null;
       aribaorderid            varchar2(255) := null;
       errorcode               integer := null;
       message                 varchar2(255) := null;
       ariba_insertdate        date := null;
       adb_l_delivery_status   char(1) := null;
    begin
      -- 4. This is never true, since adb_l_delivery_status is null, here
          -- So, I guess your trigger never does anything, so in a sense it works
       if (adb_l_delivery_status = 'N')
       then
        -- 5. This select  will raise too_many_rows, when there is more than one record in po_response.
        -- 6. It seems you will have a problem with mutating table
        -- 7. The select doesn't do anything, you never use any of the values selected
        -- 8. The select is confusing, since variables are named equally to columns
        -- 9. You select constants, why not just assign them right away
        select pttransid
                ,pttransname
                ,aribaorderid
                ,'0'
                ,sysdate
            into pttransid
                ,pttransname
                ,aribaorderid
                ,errorcode
                ,message
                ,ariba_insertdate
            from po_response;
          -- 10. This update will update ALL records in po_request, probably not what you want.
          update po_request
             set adb_l_delivery_status = 'C';
       end if;
    -- 11. Good practise dictates end po_response_trigger;
    end;
    /In general, when you think your post has been answered, then kindly mark it as such.
    Regards
    Peter

  • PLS-00201 error calling function in package member

    Hello,
    I'm trying to call a function defined in a PL/SQL package, but receiving a PLS-00201 error.

    Sorry, a finger-controller error caused me to submit before I was ready. I'm having the module replaced today. :)
    After rethinking my decision to post here, I decided not to. I've never received a helpful answer, probably because the issues are not simple... Too bad.

  • How to fix the PLS-00123 error?

    I construct about the oracle spatial sql as follow:
    declare
    ord sdo_ordinate_array := sdo_ordinate_array();
    begin
    begin for i IN 1 ..5624 LOOP
    ord extend;
    end LOOP;
    ord(1) := number1;
    ord(2) := number2;
    ord(3) := number3;
    ord(4) := number4;
    insert into table(shape,....) values(SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),ord));
    END;
    Because the count of geometry node is very long. I got the PLS-00123 error when I execute the state? somebody help me fix the problem?????
    Message was edited by:
    user646459

    It seems more on PL/SQL error to me. Have you posted your question in PL/SQL forum?
    Ming Man

  • Cyclic PLS-00538 and PLS-00539 errors?

    I've defined a supertype, t_cliente, and derived two subtypes, t_cliente_pers and t_cliente_soc. The first one has 6 member functions and the latter ones override only two of them.
    Every time I launch the script for creation I get PLS-00538 and PLS-00539 errors, but I'm not able to find out why.
    The explanation for PLS-00538 is: subprogram or cursor "string" is declared in an object type specification and must be defined in the object type body.
    For PLS-00539 is: subprogram "string" is declared in an object type body and must be defined in the object type specification.
    It's a cycle! And after all I defined these 2 functions in type specification and type body.
    I'm using 10g XE. Here's the code:
    create TYPE t_indirizzo AS OBJECT (
    via VARCHAR(45),
    numero NUMBER(4),
    cap INTEGER(5),
    citta VARCHAR(30),
    provincia VARCHAR(30),
    regione VARCHAR(30),
    MEMBER FUNCTION indirizzoCompleto RETURN VARCHAR
    create TYPE t_telefono AS OBJECT (
    num_tel NUMBER(15)
    create TYPE t_telefono_array IS VARRAY(3) OF t_telefono
    create TYPE t_anagrafica AS OBJECT (
    nome VARCHAR(45),
    cognome VARCHAR(45),
    sesso CHAR(1),
    cod_fiscale VARCHAR(16),
    data_nascita DATE
    create TYPE t_ragioneSociale AS OBJECT (
    nome_soc VARCHAR(45),
    data_cost DATE,
    part_iva NUMBER(11)
    create TYPE t_persona AS OBJECT (
    dati_anagrafici t_anagrafica,
    indirizzo t_indirizzo,
    email VARCHAR(45),
    telefono t_telefono_array
    create TYPE t_societa AS OBJECT (
    ragione_sociale t_ragioneSociale,
    indirizzo t_indirizzo,
    email VARCHAR(45),
    telefono t_telefono_array,
    persona_rif REF t_persona
    create TYPE t_cliente AS OBJECT (
    cod_cliente NUMBER(8),
    MEMBER FUNCTION incFatti RETURN NUMBER,
    MEMBER FUNCTION incSubiti RETURN NUMBER,
    MEMBER FUNCTION incFattiPeriodo RETURN NUMBER, /* this is the first function that gives me problems */
    MEMBER FUNCTION incSubitiPeriodo RETURN NUMBER, /* this is the second one */
    MEMBER FUNCTION nomeCliente RETURN VARCHAR,
    MEMBER FUNCTION tipoCliente RETURN VARCHAR
    ) NOT FINAL
    create or replace
    TYPE BODY t_cliente AS
    MEMBER FUNCTION incFatti RETURN NUMBER
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM incidente i, mezzo m
    WHERE SELF.cod_cliente = m.proprietario.cod_cliente AND m.num_targa = i.mezzo. num_targa AND i. responsabilita = 'c';
    RETURN (incidenti);
    END;
    MEMBER FUNCTION incSubiti RETURN NUMBER
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti /* here's the first PLS-00538 error */
    FROM incidente i, mezzo m /* here's the second PLS-00538 error */
    WHERE SELF.cod_cliente = m.proprietario.cod_cliente AND m.num_targa = i.mezzo. num_targa AND i. responsabilita = 's';
    RETURN (incidenti);
    END;
    MEMBER FUNCTION incFattiPeriodo(da DATE, a DATE) RETURN NUMBER /* here's the first PLS-00539 error */
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM incidente i , mezzo m
    WHERE SELF. cod_cliente = m.proprietario.cod_cliente AND m. num_targa = i.mezzo. num_targa AND i. responsabilita = 'c' AND (i.data_inc BETWEEN da and a);
    RETURN (incidenti);
    END;
    MEMBER FUNCTION incSubitiPeriodo(da DATE, a DATE) RETURN NUMBER /* here's the second PLS-00539 error */
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM incidente i , mezzo m
    WHERE SELF. cod_cliente = m.proprietario.cod_cliente AND m. num_targa = i.mezzo. num_targa AND i. responsabilita = 's' AND (i.data_inc BETWEEN da and a);
    RETURN (incidenti);
    END;
    MEMBER FUNCTION nomeCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN TO_CHAR(cod_cliente);
    END;
    MEMBER FUNCTION tipoCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN ('u');
    END;
    END;
    create TYPE t_cliente_pers UNDER t_cliente (
    persona REF t_persona,
    OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR,
    OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
    ) NOT FINAL
    create or replace
    TYPE BODY t_cliente_pers AS
    OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR
    IS nc VARCHAR(90);
    BEGIN
    SELECT concat(DEREF(SELF.persona).dati_anagrafici.nome, concat(' ',DEREF(SELF.persona).dati_anagrafici.cognome)) INTO nc
    FROM DUAL;
    RETURN (nc);
    END;
    OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN ('p');
    END;
    END;
    create TYPE t_cliente_soc UNDER t_cliente (
    societa t_societa,
    OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR,
    OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
    ) NOT FINAL
    create or replace
    TYPE BODY t_cliente_soc AS
    OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN (societa.ragione_sociale.nome_soc);
    END;
    OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN ('s');
    END;
    END;
    /

    The declarations of functions incFattiPeriodo and incSubitiPeriodo differ between type specification and type body (the ones in the type body have formal parameters).

  • Bug causing PLS-00103 error

    The following anonymous block works fine
    begin
    null;
    end;
    /but if I add a space between "end" and ";", like this
    begin
    null;
    end ;
    /I get ORA-06550 and "PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following ..." errors.
    I'm running version 1.5.4, Build MAIN-5940, on Windows XP.

    racist!
    No, really, the two should behave in the same manner, so if the syntax is correct (which is), both should work. As F9 doesn't, it's a bug.
    Regards,
    K.

  • PLS-00103 error

    can you please tell me what am i missing. i am getting below error.
    Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following:     := . ( @ % ;
    CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG"
    AS
    FUNCTION insert_pn_emp_space_assign
        RETURN NUMBER
    IS
    BEGIN
        CURSOR c_sel  IS --NO RECORDS FOUND
          SELECT room_id ,
            room_scheduler,
            benches,
            lab_type,
            room_num,
            floor_id ,
            DEPARTMENT_NAME ,
            room_eff_from_date ,
            room_eff_to_date ,
            org_id ,
            pi_id ,
            dept_pct ,
            pi_pct ,
            FUNCTIONAL_USE_PCT ,
            RESEARCH_EXPLANATION ,
            SUB_DEPT ,
            FUNCTIONAL_USE_CODE ,
            FUNCTIONAL_USE_DESCRIPTION ,
            COUNT(1)
          FROM XXDL.XXDL_CD_FACILITY k
          WHERE pi_id NOT LIKE 'FMS%'
            --and floor_id ='00'
            --and pi_id='04309605'
          AND room_eff_to_date IS NULL
            -- and room_id ='07-590-02-2134'
          AND room_id NOT IN
            (SELECT location_code
            FROM PN_SPACE_ASSIGN_EMP_V
            WHERE emp_space_assign_id IS NOT NULL
        AND EXISTS
          ( SELECT DISTINCT location_code
          FROM pn_locations_all
          WHERE room_id=location_code
            --and nvl(to_date(room_eff_to_date,'Mon/dd/RRRR'),active_end_date)=active_end_date
        GROUP BY room_id ,
          DEPARTMENT_NAME ,
          room_scheduler,
          benches,
          lab_type,
          room_num,
          floor_id ,
          room_eff_from_date ,
          room_eff_to_date ,
          org_id ,
          pi_id ,
          dept_pct ,
          pi_pct ,
          FUNCTIONAL_USE_PCT ,
          RESEARCH_EXPLANATION ,
          SUB_DEPT ,
          FUNCTIONAL_USE_CODE ,
          FUNCTIONAL_USE_DESCRIPTION
        HAVING COUNT(1)=1 ;
        CURSOR c_conc( p_room_id VARCHAR2 ,p_dept_name VARCHAR2 ,p_piid VARCHAR2 ,p_eff_date VARCHAR2 )
        IS
          SELECT FUNCTIONAL_USE_PCT ATTRIBUTE5 ,
            RESEARCH_EXPLANATION ATTRIBUTE6 ,
            SUB_DEPT ATTRIBUTE7 ,
            dept_pct ATTRIBUTE1 ,
            pi_pct ATTRIBUTE2 ,
            FUNCTIONAL_USE_CODE ATTRIBUTE3 ,
            FUNCTIONAL_USE_DESCRIPTION ATTRIBUTE4
          FROM XXDL.XXDL_CD_FACILITY
          WHERE room_id         =p_room_id
          AND department_name   =p_dept_name
          AND pi_id             =p_piid
          AND 1                 =2------not used
          AND room_eff_to_date IS NULL
            --and to_date(room_eff_to_date,'Mon/dd/RRRR')=to_date(p_eff_date,'Mon/dd/RRRR')
        l_person_id     NUMBER;
        l_location_id   NUMBER;
        l_parent_loc_id NUMBER;
        l_attribute5    VARCHAR2(500);
        l_attribute6    VARCHAR2(500);
        l_attribute7    VARCHAR2(500);
        l_attribute1    VARCHAR2(500);
        l_attribute2    VARCHAR2(500);
        l_attribute3    VARCHAR2(500);
        l_attribute4    VARCHAR2(500);
      BEGIN
           mo_global.set_policy_context('S',84);
        FOR c2 IN c_sel
        LOOP
          l_parent_loc_id:= NULL;
          BEGIN
            SELECT location_id
            INTO l_parent_loc_id -- NO RECORDS RETURNED FROM CURSOR
            FROM pn_locations_all
            WHERE location_alias          = c2.floor_id
            AND location_type_lookup_code ='FLOOR';
          EXCEPTION
          WHEN OTHERS THEN
            l_parent_loc_id:= NULL;
          END;
          l_location_id:= NULL;
          BEGIN
            SELECT location_id
            INTO l_location_id
            FROM pn_locations_all
            WHERE location_code    = c2.room_id
            AND parent_location_id =l_parent_loc_id;
          EXCEPTION
          WHEN OTHERS THEN
            l_location_id:= NULL;
          END;
          l_attribute3:=NULL;
          l_attribute4:=NULL;
          l_attribute5:=NULL;
          l_attribute6:=NULL;
          l_attribute7:=NULL;
          FOR c3      IN c_conc(c2.room_id,c2.department_name,c2.pi_id,c2.room_eff_to_date)
          LOOP
            IF l_attribute5 IS NULL THEN
              l_attribute5  :=c3.attribute3||'.'||c3.attribute5;
            ELSE
              IF c3.attribute5 IS NOT NULL THEN
                l_attribute5   :=l_attribute5||','||c3.attribute3||'.'||c3.attribute5;
              END IF;
            END IF;
            IF l_attribute6    IS NULL THEN
              IF c3.attribute6 IS NOT NULL THEN
                l_attribute6   :=c3.attribute3||'.'||c3.attribute6;
              END IF;
            ELSE
              IF c3.attribute6 IS NOT NULL THEN
                l_attribute6   :=l_attribute6||','||c3.attribute3||'.'||c3.attribute6;
              END IF;
            END IF;
            IF l_attribute7    IS NULL THEN
              IF c3.attribute7 IS NOT NULL THEN
                l_attribute7   :=c3.attribute3||'.'||c3.attribute7;
              END IF;
            ELSE
              IF c3.attribute7 IS NOT NULL THEN
                l_attribute7   :=l_attribute7||','||c3.attribute3||'.'||c3.attribute7;
              END IF;
            END IF;
            --functional code
            IF l_attribute3 IS NULL THEN
              l_attribute3  :=c3.attribute3;
            ELSE
              IF c3.attribute3 IS NOT NULL THEN
                l_attribute3   :=l_attribute3||','||c3.attribute3;
              END IF;
            END IF;
            --functional desc
            IF l_attribute4 IS NULL THEN
              l_attribute4  :=c3.attribute4;
            ELSE
              IF c3.attribute4 IS NOT NULL THEN
                l_attribute4   :=l_attribute4||','||c3.attribute4;
              END IF;
            END IF;
          END LOOP;
          l_person_id:=NULL;
          BEGIN
            SELECT person_id
            INTO l_person_id
            FROM per_all_people_f
            WHERE employee_number=c2.pi_id
            AND sysdate BETWEEN effective_start_date AND effective_end_date ;
          EXCEPTION
          WHEN OTHERS THEN
            l_person_id:=NULL;
          END;
        insert into PN_EMP_SPACE_ASSIGN_ITF
                                          BATCH_NAME                                
                                          ,ENTRY_TYPE                                
                                          ,EMP_SPACE_ASSIGN_ID                               
                                          ,LOCATION_ID                                       
                                          ,EMPLOYEE_ID                                       
                                          ,COST_CENTER_CODE                                  
                                          ,ALLOCATED_AREA                                    
                                          ,LAST_UPDATE_DATE                          
                                          ,LAST_UPDATE_LOGIN                                 
                                          ,CREATED_BY                                
                                          ,CREATION_DATE                             
                                          ,LAST_UPDATED_BY                           
                                          ,ATTRIBUTE_CATEGORY                                
                                          ,ATTRIBUTE1                                        
                                          ,ATTRIBUTE2                                        
                                          ,ATTRIBUTE3                                        
                                          ,ATTRIBUTE4                                        
                                          ,ATTRIBUTE5                                        
                                          ,ATTRIBUTE6                                        
                                          ,ATTRIBUTE7                                        
                                          ,ATTRIBUTE8                                        
                                          ,ATTRIBUTE9                                        
                                          ,ATTRIBUTE10                                       
                                          ,ATTRIBUTE11                                       
                                          ,ATTRIBUTE12                                       
                                          ,ATTRIBUTE13                                       
                                          ,ATTRIBUTE14                                       
                                          ,ATTRIBUTE15                                       
                                          ,TRANSFERRED_TO_CAD                                
                                          ,TRANSFERRED_TO_PN                                 
                                          ,ERROR_MESSAGE                                     
                                          ,SOURCE                                            
                                          ,REQUEST_ID                                        
                                          ,PROGRAM_APPLICATION_ID                            
                                          ,PROGRAM_ID                                        
                                          ,PROGRAM_UPDATE_DATE                               
                                          ,EMP_ASSIGN_START_DATE                             
                                          ,EMP_ASSIGN_END_DATE                               
                                          ,UTILIZED_AREA                                     
                                          ,CHANGE_DATE                                       
                                          ,CHANGE_MODE                                       
                                          ,PROJECT_ID                                        
                                          ,TASK_ID                                           
                                  values--custom table columns
                                          '07-590_floor_bulk_spc' --BATCH_NAME                                
                                          ,'A' --ENTRY_TYPE                                
                                          ,PN_SPACE_ASSIGN_EMP_S.nextval --EMP_SPACE_ASSIGN_ID                               
                                          ,l_location_id --LOCATION_ID                                       
                                          ,l_person_id --EMPLOYEE_ID                                       
                                          ,1028389 --COST_CENTER_CODE                                  
                                          ,0 --ALLOCATED_AREA                                    
                                          ,sysdate --LAST_UPDATE_DATE                          
                                          ,157092 --LAST_UPDATE_LOGIN                                 
                                          ,157092 --CREATED_BY                                
                                          ,sysdate --CREATION_DATE                             
                                          ,157092 --LAST_UPDATED_BY                           
                                          ,null --ATTRIBUTE_CATEGORY                                
                                          ,c2.dept_pct --ATTRIBUTE1                                        
                                          ,c2.pi_pct --ATTRIBUTE2                                        
                                          ,C2.FUNCTIONAL_USE_CODE --ATTRIBUTE3                                        
                                          ,C2.FUNCTIONAL_USE_DESCRIPTION  --ATTRIBUTE4                                        
                                          ,C2.FUNCTIONAL_USE_PCT  --ATTRIBUTE5                                        
                                          ,C2.RESEARCH_EXPLANATION --ATTRIBUTE6                                        
                                          ,C2.SUB_DEPT --ATTRIBUTE7                                        
                                          ,null --ATTRIBUTE8                                        
                                          ,null --ATTRIBUTE9                                        
                                          ,null --ATTRIBUTE10                                       
                                          ,c2.ORG_Id||'-'||c2.DEPARTMENT_NAME --ATTRIBUTE11                                       
                                          ,null --ATTRIBUTE12                                       
                                          ,null --ATTRIBUTE13                                       
                                          ,null --ATTRIBUTE14                                       
                                          ,null --ATTRIBUTE15                                       
                                          ,null --TRANSFERRED_TO_CAD                                
                                          ,null --TRANSFERRED_TO_PN                                 
                                          ,null --ERROR_MESSAGE                                     
                                          ,'TST' --SOURCE                                            
                                          ,null --REQUEST_ID                                        
                                          ,null --PROGRAM_APPLICATION_ID                            
                                          ,null --PROGRAM_ID                                        
                                          ,null --PROGRAM_UPDATE_DATE                               
                                          ,to_date(c2.room_eff_from_date,'mon/dd/RRRR') --EMP_ASSIGN_START_DATE                             
                                          ,to_date(c2.room_eff_to_date,'mon/dd/RRRR')  --EMP_ASSIGN_END_DATE                               
                                          ,null --UTILIZED_AREA                                     
                                          ,null --CHANGE_DATE                                       
                                          ,null --CHANGE_MODE                                       
                                          ,null --PROJECT_ID                                        
                                          ,null --TASK_ID   --07-590-02-ELEV02
        END LOOP;
      RETURN 1;
    EXCEPTION
           WHEN OTHERS THEN
               FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while insert_pn_emp_space_assign - '||sqlerrm);
                  RETURN 0;
            END;
          WHEN OTHERS THEN
            FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while insert_pn_emp_space_assign - '||sqlerrm);
            RETURN 0;
      END insert_pn_emp_space_assign;
      END XXDL_PN_LOAD_EMP_ASSIGN_PKG;

    893185 wrote:
    can you please tell me what am i missing. i am getting below error.
    Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following:     := . ( @ % ;
    CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG"
    AS
    FUNCTION insert_pn_emp_space_assign
    RETURN NUMBER
    IS
    BEGINremove "BEGIN" from line above

  • PLS-00103 Error While Creating Procedure

    I am attempting to create the following procedure following the guidelines in Metalink Doc ID #118040.1 and I keep receiving the following error at Line #22:
    Error(22,65): PLS-00103: Encountered the symbol ":" when expecting one of the following: := . ( % ; The symbol ":= was inserted before ":" to continue.
    Here is my procedure code:
    PROCEDURE sw_load_image( position IN NUMBER, filename VARCHAR2) AS
    f_lob BFILE;
         b_lob BLOB;
         image_name VARCHAR2(30);
         mime_type VARCHAR2(30);
         dot_pos NUMBER;
    BEGIN
    -- Find the position of the dot ('.') located in the filename
         dot_pos := INSTR(filename, '.');
         -- Get the filename without extension and use it as image name
         image_name := SUBSTR(filename,1,dot_pos-1);
         -- Build the mime type. Retrieve the file extension and add it to 'image/'
         mime_type := 'image/'||SUBSTR( filename, dot_pos+1, length(filename) );
         INSERT INTO sw_images values(position, image_name, mime_type, empty_blob() ) RETURN img_data INTO b_lob;
         f_lob := BFILENAME('IMG2LOAD', filename);
         dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
         dbms_lob.loadfromfile(b_lob, f_lob, dbms_lob.getlength(f_lob) ):
         dbms_lob.fileclose(f_lob);
         COMMIT;
    END;
    Line #22 is the line that starts 'dbms_lob.loadfromfile'. I am not seeing where I have made a mistake. Does anyone else see where I've made a mistake?
    This procedure is being created on a 9i database running on W2K server and W2K client.
    Thanks,
    Jason

    Thanks! As many times as I looked at that I can't believe I didn't see that. Thanks again.

  • Help on ORA-06550 & PLS-00363 Error while running a procedure from a packag

    Greeting All,
    I ran the following procedure from a package on a command line in sqlplus:
    SQL> exec QUALITY_ASSURANCE.COPY_SW_RESOURCES(2009,2010,9508);Where '2009' is the old fiscal year, '2010' is the new fiscal year and '9508' is the error code passed from the calling program. But, I received the following error messages:
    ERROR at line 1:
    ORA-06550: line 1, column 53:
    PLS-00363: expression '9508' cannot be used as an assignment target
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Any thoughts, suggestions and/or advice to resolve these errors.
    Thanks in advance.

    Orchid wrote:
    Justin,
    Thanks for your response and information. Yes, Theoa was correct the 3rd parameter is an OUT variable, and it is a numeric field. The procedure was called by a form as follows:
    QUALITY_ASSURANCE.COPY_SW_RESOURCES(:BLK_CONTROL.FROMFY,:BLK_CONTROL.TOFY,V_ERR);But the form does not work so I am trying to isolate the problem by running the procedure by itself in sqlplus to make sure there is no problem with the procedure.
    Yesterday, I was able to run the procedure in Toad for Oracle to a successful completion by providing the 3 parameters: (2009, 2010, null). Just wonder why I cannot run the same procedure with the same parameters on a command line in sqlplus as follows:
    exec QUALITY_ASSURANCE.COPY_SW_RESOURCES(2009,2010,null);So, if I understand your suggestion correctly, in order to run the procedure with the 3 parameter successfully in sqlplus,
    I have to declare the 3rd parameter in PL/SQL. That is to create a PL/SQL file as suggested and run the file, correct? CORRECT!

  • ORA-06550/PLS-00201 error while configuring data source

    Hi,
    My development platform is Visual Studio 2005, ODAC11g Release 1 (11.1.0.6.20), and Oracle 10g Release 2 database.
    I tried to setup a sqlDatasource in my web page using drag and drop features
    When I configure the sqlDatasource to use a stored procedure inside a package,
    I notice that odp.net uses #0# as separator (instead of .) between package name and procedure name in Configure Data Source dialog box. Then when I clcik the Test Query button, I got following error.
    There was an error executing the query. Please check the syntax of the command and if present, the types and values of the parameters and ensure they are correct.
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'PK_LOOKUP_TABLE#0#P_LIST' must be declared
    ORA-06550: line 1, column 7
    PL/SQL: Statement ignored
    It looks like odp.net cannot locate PK_LOOKUP_TABLE#0#P_LIST.
    Is there any workaround ?
    Below is the stored procedure code. It compiles and runs without problem.
    PACKAGE BODY pk_lookup_table
    AS
    /* Get a list of lookup table name */
    PROCEDURE P_LIST (
    O_CURSOR OUT sys_refcursor )
    IS
    l_cur sys_refcursor;
    BEGIN -- executable part starts here
    OPEN l_cur FOR
    SELECT table_name
    FROM all_tab_comments u
    WHERE u.comments LIKE '%Lookup Table%'
    ORDER BY 1;
    o_cursor := l_cur;
    END P_LIST;
    END "PK_LOOKUP_TABLE";
    On the sqlDataSource property sheet, if I click the Select Query property, the Command and Parameter Editor will open, then I can change the select command name to PK_LOOKUP_TABLE.P_LIST. Then if I run the application, I get another error.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: Oracle.DataAccess.Client.OracleException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'P_LIST'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Seems that it can locate the procedure.
    In the Command and Parameter Editor dialog, I can add output parameter, but data type is restricted. There is no REF CURSOR datatype in the dropdown list.
    How can I add output parameter with REF CURSOR type via IDE ?
    Thanks for the time looking into this issue.
    Mansion

    Hi
    Even I faced this problem while connecting to RMAN . But I feel your problem is different .
    My issue was like this
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04005: error from target database:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBMS_BACKUP_RESTORE.SET_CHARSET' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    RMAN-04015: error setting target database character set to WE8MSWIN1252
    Solution :
    execute catproc.sql;

  • PLS-00201 error when trying to pass an OUT parameter

    Hi,
    Please help me to resolve the below error:
    I am trying to pass an OUT parameter in a package.
    I have declared it in package specs as
    ProcABC(p_val IN varchar2, p_val2 IN varchar2, p_val3 OUT varchar2)
    In package body
    I have created the procedure as
    Create or Replace procedure ProcABC(p_val IN varchar2, p_val2 IN varchar2, p_val3 OUT varchar2) AS
    v_LogDir varchar2(40);
    v_message varchar2(200);
    BEGIN
    SELECT directory_path into v_LogDir FROM ALL_DIRECTORIES WHERE directory_name = 'ABC';
    v_message := v_LogDir ;
    some sql statements..
    p_val3 := v_message;
    Return p_val3;
    End procABC;
    SQL> exec pkg_A.procABC('Stage2', NULL, p_val3);
    Package compiles successfully but while execution it returns error as:
    ORA-06550: line 1, column 74:
    PLS-00201: identifier 'p_val3 ' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Please advise.

    Hi Suresh,
    Thanks for the information and help. I was able to run the package with this usage.
    Now, the issue is
    I need to return a v long string by the OUT parameter so I defined the datatype of OUT parameter as CLOB.
    But, when I declare local variable to run the package with this OUT paramater I get the error :
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 1
    When I pass a shorter string it works.
    Kindly advise me how to resolve this issue while using CLOB as datatype of OUT parameter.

  • Calling stored procedure from page process and PLS-00049 error?

    Good morning guys!
    I'm dealing with several problems this morning! The one that I need to deal with first is the following.
    I created the page process (see below: 1st code) in order to validate if all records where LNG_GEBIET matches have the status 3 or 4. If that is the case I want to call the procedure "set_status_arbeit_zu_gebiet". If amountrs and countstat do not match, then nothing is supposed to be done.
    The problem lies within the stored procedure itself. I receive a PLS-00049 bind variable error for :new.LNG_GEBIET.
    Can you please tell me what I forgot to declare in code 2 below???
    Thank you guys!
    The page process:
    Declare
      amountrs    number;
      countstat   number;
    begin
    SELECT COUNT(*) INTO amountrs FROM TBL_PUNKTDATEN where LNG_GEBIET = :P4_CNT_GEBIET;
    SELECT COUNT(*) INTO countstat FROM TBL_PUNKTDATEN where LNG_GEBIET = :P4_CNT_GEBIET and INT_STATUS = 3 or LNG_GEBIET = :P4_CNT_GEBIET and INT_STATUS = 4;
        IF amountrs = countstat THEN
         set_status_arbeit_zu_gebiet;
        ELSE
         dbms_output.put('nothing');
        END IF ;
    end;Code 2 with the true problem!
    CREATE OR REPLACE PROCEDURE set_status_arbeit_zu_gebiet
    IS
        cursor c2 is select LNG_GEBIET from TBL_ARBEIT_ZU_GEBIET where PNUM = 1114 and LNG_GEBIET=:new.LNG_GEBIET;
        v_c2  c2%ROWTYPE;
    BEGIN
       open c2;
    fetch c2 into v_c2;
    if c2%notfound then
            INSERT INTO TBL_ARBEIT_ZU_GEBIET
            LNG_GEBIET,
              LNG_ARBEITSSCHRITT,
              PNUM,
              INT_BEARBEITER,
              DATE_DATUM,
              GEPL_DATUM
            VALUES
            (:new.LNG_GEBIET,
             52,
             1114,
             895,
             sysdate,
             to_date('01.01.1990', 'DD.MM.YYYY')
            commit;
            close c2;
    END set_status_arbeit_zu_gebiet;One more question: Is it possible to integrate the first validation that calls my stored procedure into code 2?
    Thanks for you time!
    Sebastian

    The error is in following statement:
    INSERT INTO TBL_ARBEIT_ZU_GEBIET ( ... ) VALUES ( :new.LNG_GEBIET, ... );
    As the statement is part of a procedure and not trigger so it is not able to bind this variable with any value.
    As a resolution, pass this value to the procedure from the process and use it in the insert statement.
    The process will have following IF statement:_
    IF amountrs = countstat THEN
    set_status_arbeit_zu_gebiet *(:P4_CNT_GEBIET)*;
    ELSE
    dbms_output.put('nothing');
    END IF ;
    and the procedure will be as follows:_
    CREATE OR REPLACE PROCEDURE set_status_arbeit_zu_gebiet *(p_lng_gebit varchar2)*
    IS
    cursor c2 is select LNG_GEBIET from TBL_ARBEIT_ZU_GEBIET where PNUM = 1114 and LNG_GEBIET= --:new.LNG_GEBIET-- p_lng_gebit ;
    v_c2 c2%ROWTYPE;
    BEGIN
    INSERT INTO TBL_ARBEIT_ZU_GEBIET ( ... )
    VALUES
    ( --:new.LNG_GEBIET--  p_lng_gebit, ... );
    END set_status_arbeit_zu_gebiet;

  • PLS-00049 error :bad bind variable

    We recently migrated our dev databse to 10g
    for the following table the trigger is erroring out as follows :
    The same trigger works in 9i production though .Can anyone see anything that might be amiss
    CREATE TABLE ARCH_CLAIM_REJECTION_CODES
    REJECTION_ID NUMBER(38) NOT NULL,
    REJECTION_DESC VARCHAR2(600 BYTE),
    DT_STAMP NUMBER,
    DT_CREATED DATE,
    DT_LAST_UPDATED DATE
    INSERT INTO CLAIM VALUES (
    :OLD.REJECTION_ID,
    :OLD.REJECTION_DESC,
    :OLD.DT_STAMP,
    :OLD.DT_LAST_UPDATED,
    :OLD.DT_CREATED
    PLS-00049: bad bind variable 'OLD.REJECTION_ID'
    PLS-00049: bad bind variable 'OLD.REJECTION_DESC'
    PLS-00049: bad bind variable 'OLD.DT_STAMP'
    PLS-00049: bad bind variable 'OLD.DT_LAST_UPDATED'
    PLS-00049: bad bind variable 'OLD.DT_CREATED'

    REATE OR REPLACE TRIGGER ODSLIVE.TR_CLAIM_REJECTION_CODES_BUR
    BEFORE UPDATE ON CLAIM_REJECTION_CODES
    FOR EACH ROW
    DECLARE
    gv_errcode VARCHAR2(100);
    gv_errmsg VARCHAR2(100);
    BEGIN
    --DBMS_OUTPUT.PUT_LINE('TRIGGER CALLED FOR CLAIM_REJECTION_CODES');
    INSERT INTO ARCH_CLAIM_REJECTION_CODES VALUES (
    :OLD.REJECTION_ID,
    :OLD.REJECTION_DESC,
    :OLD.DT_STAMP,
    :OLD.DT_LAST_UPDATED,
    :OLD.DT_CREATED
    EXCEPTION
    WHEN OTHERS THEN
    gv_errcode :=SQLCODE;
    gv_errmsg :=SQLERRM;
    PKG_COMMONACTIVITIES.PR_ERRORLOG_DETAILS('TRIG-01-0001',
    gv_errcode,
    gv_errmsg,
    'TR_CLAIM_REJECTION_CODES_BUR',
    'CLAIM_REJECTION_CODES');
    --DBMS_OUTPUT.PUT_LINE('TM-01-0001 '||'TR_CLAIM_REJECTION_CODES_BUR '||'CLAIM_REJECTION_CODES'||gv_errmsg);
    --RAISE;
    END TR_CLAIM_REJECTION_CODES_BUR;

Maybe you are looking for