PLS-00302: component must be declared 9i

Hi all

I'm trying to create a proc on the 9i database. The object that is created with compilation errors. This error only throws on the 9i version. Same scenario for proc creation works well on 10g & above versions.

Kind regards

RP.

This is because the purge has been an addition of 10 gR 1.

Edit: Oh yes, sppurge.sql

Tags: Database

Similar Questions

  • PLS-00302: component must be declared.

    Hi all

    As a user MEXX, I created the following procedure... I can able to execute the procedure... When I give debugging, run on this proc to user test1 prov... get the error:

    PLS-00302: component '. D_COMMAND' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    the user test1 has all the necessary rights on the tables EIM_EXECUTED_COMMANDS, EIM_COMMAND_RECORD and the sequence spc_trans... I created synonyms private for all that it opposes in the test1 schema...
    CREATE OR REPLACE PROCEDURE MEXX.D_COMMANDS AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    CURSOR CR_MJI_SIN IS
    SELECT sno, cno, iumber  FROM TEST1.m_mca;
      C_SUBNO VARCHAR2 (20);
      C_CARDNO VARCHAR2 (12);
      C_IMSI_NUMBER VARCHAR2 (30);
      TRANSNO1 NUMBER (8);
        BEGIN
      OPEN CR_SMS_SUB;
      LOOP
        FETCH CR_SMS_SUB INTO C_SUBNO,C_CARDNO,C_IMSI_NUMBER;
        EXIT WHEN CR_SMS_SUB%notfound;
       SELECT  spc_trans.NEXTVAL INTO TRANSNO1 FROM DUAL;
       INSERT INTO EIM_COMMAND_RECORD ( SUBSCR_TYPE, AREA, SUBNO, SERORDNO, TRANSNO, EXC, EXCSYSTEM,
                  PORTNO, SPC_FUNCTION, APPDATE, NXTROUTINE, RETRANSMIT, TRANSSTATUS, EQUIPID, SOTYPE, CARDNO, CARD_TYPE)
            VALUES ( 'G', '0', C_SUBNO, NULL , TRANSNO1, 'GSM1', 'GSM1', '1', 'SERI', sysdate, 'SPC001', 'Y', 10, 'MCA' , 66, C_CARDNO, 'PLI');
       INSERT INTO EIM_EXECUTED_COMMANDS ( TRANSNO, CMDNO, COMMAND, TIMEOUT)
            VALUES (TRANSNO1, 1, 'ADD MCA FOR '||C_SUBNO||' USING (IMSINO='||C_IMSI_NUMBER||')', 30);
      END LOOP;
      CLOSE CR_SMS_SUB;
      COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
          raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    /
    Thank you
    Kai

    Hi Kai,

    That's true, then, that you have an object in the schema TEST1 called MEXX?

    If so, I guess you can

    Drop that
    or
    Rename that
    or
    Create synonm private TEST1. D_COMMAND for MEXX. D_COMMAND
    or (my favorite)
    declare D_COMMAND within a packet, instead

    Concerning
    Peter

  • PLS-00302: component 'ADD_DATATYPE_INDEX' must be declared.

    Hello guys,.
    I'm trying to add a data type index to my semantic network to explore search in full text on RDF describes the data.
    But facing the following error I would like to ask for help if someone can make a suggestion how can I fix this problem.
    Thanks in advance!

    SQL > show user
    The USER is "SYS".
    SQL > EXECUTE SEM_APIS. ADD_DATATYPE_INDEX ('http://xmlns.oracle.com/rdf/text');
    BEGIN SEM_APIS. ADD_DATATYPE_INDEX ('http://xmlns.oracle.com/rdf/text'); END;

    *
    ERROR on line 1:
    ORA-06550: line 1, column 16:
    PLS-00302: component 'ADD_DATATYPE_INDEX' must be declared.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    --------

    In addition, I conducted the following audits:
    SQL > SELECT STATUS FROM DBA_OBJECTS WHERE OBJECT_NAME = 'SEM_APIS ';

    STATUS

    VALID

    Published by: 913830 on February 14, 2012 11:41

    Published by: 913830 on February 14, 2012 11:48

    You must upgrade your database to 11.2.0.2.0 or 11.2.0.3.0 to get the support of text indexing. Two updates should be available through My Oracle Support. 11.2.0.3.0 contains a native support for named graphs.

    Thank you
    Matt

  • PLS-00302: component 'CHAIN' must be declared

    Hello together,

    I'm new to PL/SQL. I have the following problem.

    I get the following errors in Oracle 10 g R2:

    256/18-PLS-00597: expression "PRUEFE_TAB" in the list IS evil
    type

    263/13 PL/SQL: statement ignored
    263/27-PLS-00302: component 'ENDDATUM' must be declared

    In the following Code Snnipet, I have demolished all (IMO) Code unrelevant.
        procedure pruefe_wiederaufsetzpunkt(procname_p in varchar2, datenherkunft_p in number, returncode_p out number, 
                                            import_wiederauf_p out date) as
    
            cursor pruefe_cur (procname_cp varchar2, datenherkunft_cp number) is
            select proc.wiederauf_id as wiederauf_id,
                   proc.procname as procname,
                   proc.import_id as import_id,
                   proc.startdatum as startdatum,
                   proc.enddatum as enddatum,
                   proc.wiederaufdatum as wiederaufdatum,
                   lead(proc.enddatum) over (order by wiederauf_id desc) as next_enddatum,
                   lead(proc.wiederauf_id) over (order by wiederauf_id desc) as next_wiederauf_id,
                   imp.import_von as import_von
            from bws_odsimp_proc proc
                 inner join bws_import_auftrag imp
                 on (proc.import_id = imp.import_id) 
            where proc.procname = procname_cp
            and proc.datenherkunft = datenherkunft_cp
            order by wiederauf_id desc;
            
            type pruefe_type is table of pruefe_cur%rowtype;
            pruefe_tab pruefe_type; 
    
        begin
            open pruefe_cur(procname_p, datenherkunft_p);
            loop
                fetch pruefe_cur
                into pruefe_tab;
    ...
                     if pruefe_tab.enddatum is null then
    ...
                end if;            
            end loop;
            close pruefe_cur;        
        end pruefe_wiederaufsetzpunkt;
    Now, I'll tell you what I think that what the code:

    I think I declare an array of the type of the cursor. Then I get in a loop for each row of an execution in the set table. And later I want to get 'access' cervical 'ENDDATUM' in my line retrieved information

    Can someone helpl me to find the right way for this?

    Thank you very much

    concerning

    Published by: user10283133 on 28.10.2008 04:21

    Try directly declaring the variable rather than by defining the type declaring the variable as below:

    pruefe_tab pruefe_cur % rowtype;

  • adpatch fails with PLS-00302: component 'INITIALIZE_WITH_CALENDAR' must be

    Hi guru...

    This is my first post. I'm a new dba.

    When applying adpatch, I get the below error. Help, please. It's on r12.

    About to make treatment of PIR...

    Attempting to process files of PIR...

    AutoPatch error:
    Error in adusnapRunAdPostPatch() during the execution of statement

    AutoPatch error:
    ORA-06550: line 1, column 16:
    PLS-00302: component 'INITIALIZE_WITH_CALENDAR' must be declared.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at the 'APPS '. FND_GLOBAL', line 413
    ORA-06512: at the 'APPS '. FND_GLOBAL', line 2272
    ORA-06512: at the 'APPS '. FND_GLOBAL', line 2546
    ORA-06512: at the 'APPS '. FND_GLOBAL', line 2698
    ORA-06512: at the 'APPS '. FND_GLOBAL', line 2636
    ORA-06512: at the 'APPS '. FND_ADPATCH", line 53
    ORA-06512: at line 3 level


    There was an error processing the files of the IREP, continues...

    Treatment is PIR.

    Thank you...

    I'm going to recreated the FND_DATE packages, in accordance with the rating? -What helps?

    If it is higher, then it can be useful - please make a backup of the current package code before recreating then re - apply the patch.

    Thank you
    Hussein

  • NextVal component must be declared

    Hi all, when I try to use a sequence in my package, I get the error message like * PLS-00302: component 'NEXTVAL' must be declared *. Kindly guide me where I am doing wrong.
    CURSOR regal_edi846_seq IS
    SELECT regal_edi846_seq.nextval
    FROM   dual;
    
    PLS-00302: component 'NEXTVAL' must be declared
    Any help is appreciated,

    Thanks in advance!

    Sandy wrote:

    CURSOR regal_edi846_seq IS
    SELECT regal_edi846_seq.nextval
    FROM   dual;
    

    Name collision.

    Your cursor variable is called regal_edi846_seq.

    The name of your sequence is also called regal_edi846_seq.

    How is the PL/SQL engine suppose to understand when you refer to the variable cursor and when the sequence, when names that you use for the two are the same?

  • PLS-00201: identifier must be declared.

    --header
    
    create or replace
    package session_info
    as
      function get_osuser
      return v$session.OSUSER%type;
    end;
    
    --body 
    
    create or replace
    package body session_info
    as
      function get_osuser
      return v$session.OSUSER%type
      as
        osusername v$session.OSUSER%type;
      begin
        begin
          select upper(osuser)
          into osusername
          from v$session
          where audsid = USERENV('SESSIONID')
          and rownum = 1;
        exception
          when others then
             osusername := substr(user, 1, 30);
         end;
         return substr(osusername || '_' || user, 1, 30);
      exception
        when others then
           return 'SESSION_INFO ERROR';
      end;
    end;
    
    --error
    Error(4,3): PL/SQL: Declaration ignored
    Error(5,10): PLS-00201: identifier 'V$SESSION' must be declared
    can someone help me? where I have to declare v$ session?

    Objects stored with (by default) Copyright ignore privileges based on roles. Most likely, owner package session_info user is granted select on v$ session through the role (or not at all). Grant select on v_$ session to the owner of the package directly.

    SY.

  • REGISTER_BINARYXML must be declared

    Hello, everyone.

    I can't try to create a binary storageschema.

    I use the procedure dbms_xmlschema.registerschema as below:

    () dbms_xmlschema.registerschema

    schemaurl = > ' http://www.ESBR.com.br/aneelbmp.v1.xsd '

    , schemadoc = > doc

    local = > true

    , genTypes = > false

    , genbean = > false

    , genTables = > false

    , force = > false

    , owner = > "

    , enableHierarchy = > dbms_xmlschema. ENABLE_HIERARCHY_NONE

    options = > 0

    );

    The ""doc ' variable is an xmltype that constains xml schema. "

    It running, I get the following error:

    ORA-06550: line 80, column 31:

    PLS-00302: component 'REGISTER_BINARYXML' must be declared.

    ORA-06550: line 70, column 3:

    PL/SQL: Statement ignored

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

    * Cause: Usually a PL/SQL compilation error.

    * Action:

    It that I do not specify that option, I can create the schema without problem. In fact, I have already created the whole scenario with CLOB storage types and object / relational . And everything works fine. But I really want to use Binary , since after you create the xml document, I have zero handling and just a couple of xml queries to do some cross-validation.

    For what I read, it seems like a bug. Does anyone know something?

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    PL/SQL Release 10.2.0.4.0 - Production

    "CORE 10.2.0.4.0 Production."

    ...

    ... Storage XML binary did not exist in version 10.2 of the database and was introduced as a new storage option in version 11.1 of the database

    ...

    HTH

    (strongly advise you to upgrade to a version of basic support anyway, aware, a good option would be version 11.2.0.3/4 or 12.1.0.2)

  • PLSQL procedure error "component must be reported.

    Hello
    Greetings

    I need to write a PLSQL procedure to compare the data between two different requests (through the collection), but in the face of an error

    VERSION - Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    EXAMPLE OF CODE-


    CREATE or REPLACE procedure V_test

    type v_record is (record
    CUSTOMER_TYPE varchar2 (10),
    PRODUCT_CATEGORY varchar2 (10),
    PRODUCT_DESC varchar2 (40));

    type v_tst1 is table of v_record INDEX OF pls_INTEGER;
    V_TEST1 v_tst1;

    type v_tst2 is table of v_record INDEX OF pls_INTEGER;
    V_TEST2 v_tst2;


    Start


    Select CUSTOMER_TYPE, b.PRODUCT_CATEGORY, c.PRODUCT_DESC
    BULK COLLECT INTO V_TEST1
    of a, b, c
    where a.PRODUCT_CATEGORYD = b.PRODUCT_CATEGORY and a.PRODUCT = c.PRODUC
    CUSTOMER_TYPE, PRODUCT_CATEGORY, PRODUCT_DESC group;



    Select CUSTOMER_TYPE, PRODUCT_CATEGORY, PRODUCT_DESC
    BULK COLLECT INTO VAS_TEST2
    d
    Group of CUSTOMER_TYPE, b.PRODUCT_CATEGORY, c.PRODUCT_DESC;



    BECAUSE me in V_TEST1. FIRST... V_TEST1. LAST
    LOOP
    FOR j IN V_TEST2. FIRST... V_TEST2. LAST
    loop


    If VAS_TEST1. CUSTOMER_TYPE (i) = VAS_TEST2. CUSTOMER_TYPE (j) then
    If VAS_TEST1. PRODUCT_CATEGORY (i) = VAS_TEST2. PRODUCT_CATEGORY (j) then


    insert into v_tab values (sysdate, V_TEST1. CUSTOMER_TYPE (i), V_TEST1. PRODUCT_CATEGORY (i), V_TEST1. PRODUCT_DESC (i));
    commit;

    end if;

    end if;



    END LOOP;



    END LOOP;
    END;
    /

    ERROR - "PLS-00302: component 'CUSTOMER_TYPE' must be declared '.

    Thank you in advance to suggest corrections or alternatives
  • ORA-06550-PLS-00302 error on execution mapping

    I have a mapping in OWB 11.2.0.3, I can bend and validate.
    But if I like him to run it it fails with the following error:
    ORA-06550: line 1, column 1487: PLS-00302: component 'MAPPING_NAME' must be declared ORA-06550: line 1, column 1470: PL/SQL: statement ignored

    I've already found a post that said: grant run owner_name. "' name map ' to user_name;
    In my case it does solve the problem.

    Someone at - it an idea of what the problem might be?


    Thanks for any help,

    Benjamin

    We have the same problem on OWB 11.2.0.3 and resolved to rename a schema name, because it was the same thing to another database object. If this is your case, you can change the name of the database schema and the location on OWB.
    We hope this help you.

    To view the possible duplicate objects (drawing object):

    SELECT *.
    FROM DBA_OBJECTS
    WHERE OBJECT_NAME = '';

    On the Oracle document is much better explained:

    [http://docs.oracle.com/cd/E11882_01/relnotes.112/e24470/toc.htm]

    Oracle® Warehouse Builder Release Notes
    * 11g Release 2 (11.2) part number E24470-05 *.

    [...]

    7.14 existence of an object in the schema with the same name as the schema target in the database
    12776878: If an object exists in the schema with the same name as the schema target in the database, an error is displayed.

    For example:

    Named A schema has an object called q. schema named Q exists and has an object called Z.
    When you call from SchemaQ.ObjectZ to a scheme A, it looks in schema A Q.Z. Z is not found and displays the following error:

    ORA-06550:... : PLS-00302: component 'XYZ' must be declared
    Workaround: rename one of the objects Q to R or one letter other than Q.

    [...]

  • PLS-00302 in FOR... LOOP

    Hi all
    I have the following query.

    DECLARE
    I HAVE INTEGER;
    BEGIN
    DBMS_OUTPUT. ENABLE (60000);
    I: = 1;
    FOR TBL IN
    (
    SELECT pa.width, pa.cutoff, PR.*,
    CALCULATEMR (PR. OIMPS, PA. BRACKETID, 4, 1) "ORIGINALMRIMPSc."
    CALCULATEMR (PR. FPOUNDS, PA. BRACKETID, 4, 2) "FOLLOWMRIMPSc."
    CALCULATEPERCENT (PR. RPOUNDS, PA. BRACKETID, 4) 'RUNPERCENTc '.
    OF ALLOWANCERANGE PR
    INTERNAL ALLOCATION PA PA JOIN NOW. ALLOWANCEID IS PR. ALLOWANCEID
    INNER JOIN GATHERENGINE ON GP GP. BRACKETID = PA. BRACKETID
    WHERE GP. GATHERENGINEID IN (26105)
    )
    LOOP

    DBMS_OUTPUT. Put_line (TBL.width |) » '|| TBL.cutoff |' '|| TAM ORIGINALMRIMPSc | » '|| TAM FOLLOWMRIMPSc | » '|| TAM RUNPERCENTc);

    END LOOP;
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. PUT_LINE ("ERROR RUNNING THE SCRIPT...'");
    END;


    Here, CALCULATEMR and CALCULATEPERCENT are two functions defined by the user. When I run the script, I got the following error:

    ORA-06550: line 22, column 196:
    PLS-00302: component 'ORIGINALMRIMPSc' must be declared.
    ORA-06550: line 22, column 4:
    PL/SQL: Statement ignored.

    Please let me know what I'm missing here.
    Thank you in advance,
    Pradeep

    You have a special requirement to use double quotes (alias ID quotes)? (I hope not..., but some people are fond of the case of the column names, code generators use them...)

    Problem is that you will then have to use everywhere as a result.
    In other words: best thing would be to remove all the double quotes and be done with it.
    Or, if you must, try to reverse the process:

    declare
     i integer;
    begin
     dbms_output.enable(60000);
     i := 1;
     for tbl in (select pa.width,
                        pa.cutoff,
                        pr.*,
                        calculatemr(pr.oimps, pa.bracketid, 4, 1) "ORIGINALMRIMPSc",
                        calculatemr(pr.fpounds, pa.bracketid, 4, 2) "FOLLOWMRIMPSc",
                        calculatepercent(pr.rpounds, pa.bracketid, 4) "RUNPERCENTc"
                   from allowancerange pr
                  inner join allowance pa
                     on pa.allowanceid = pr.allowanceid
                  inner join gatherengine gp
                     on gp.bracketid = pa.bracketid
                  where gp.gatherengineid in (26105))
     loop
      dbms_output.put_line(tbl.width||' '||
                           tbl.cutoff||' '||
                           tbl."ORIGINALMRIMPSc"||' '||
                           tbl."FOLLOWMRIMPSc"||' '||
                           tbl."RUNPERCENTc"
                           );
     end loop;
    end;
    

    "Quoted identifiers are rarely necessary, but sometimes they can be useful."
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/fundamentals.htm#sthref319
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/sql_elements008.htm#sthref723

  • PLS-00302% column type other schema

    Hello!

    I came across the following error of the puzzle game in Linux 10.2.0.1.0 Oracle.
    I'm trying to define the following type:

    create or replace PACKAGE MYSCHEMA. PACOTE ACE
    TYPE rnoRow IS RECORD (order OTHERSCHEMA. Regras_Objectos.Ordem%type);
    end MYSCHEMA. PACOTE;
    /

    The error I got is:
    Error (205,71): PLS-00302: component 'Regras_Objectos' must be declared

    It's the definition of the table:

    CREATE TABLE 'OTHERSCHEMA '. "" REGRAS_OBJECTOS ".
    (SELECT "ORDER" NUMBER (5.0) NOT NULL,)
    ACTIVATE THE "OBJECTING" VARCHAR2 (2 BYTE) NOT NULL,
    VARCHAR2 (255 BYTE) "DESCRIPTION."
    "OBSERVATION" VARCHAR2 (255 BYTE),
    VARCHAR2 (50 BYTE) "GS_TYPE."
    VARCHAR2 (50 BYTE) "GS_STYPE."
    'REGRAS_OBJECTOS_PK' CONSTRAINT PRIMARY KEY ("OBJECTING")
    );

    I can connect to MYSCHEMA/MYSCHEMA and bring a select statement to OTHERSCHEMA without problem:
    select count () of "OTHERSCHEMA". "" REGRAS_OBJECTOS "; *

    So the problem may not be the permissions. Just in case I granted access to all for this table.

    Someone has an idea what is the problem?
    This code works fine in 9g for Windows.

    For not stuck, we have created a view and deleted a reference to OTHERSCHEMA (check the following)
    But we must avoid a branch of code source diferent from the official.

    connect myschema/myschema;
    create view MYSCHEMA. Regras_Objectos in select * from OTHERSCHEMA. Regras_Objectos;

    create or replace PACKAGE MYSCHEMA. PACOTE ACE
    TYPE rnoRow IS RECORD (order OTHERSCHEMA. Regras_Objectos.Ordem%type);
    end MYSCHEMA. PACOTE;
    /
    CREATE OR REPLACE PACKAGE BODY MYSCHEMA. PACOTE ACE
    END MYSCHEMA. PACOTE;
    /

    Thanks for any input on this!

    Edu

    9g for Windows

    You mean 9i?

    Create a synonym and then try to access this object.

    Kind regards.

    LOULOU.

  • Component 'ACTION' must be declared

    Hi all

    Oracle version: 12 c.

    I am trying to create a trigger on a history table.

    Here is the description of the tables,

    Main table:

    create table CASES

    (

    case_id NUMBER (14) not null,

    case_number VARCHAR2 (50) not null,

    judgement_date DATE,

    account_ID NUMBER (14) not null,

    case_status_reason_id NUMBER (14) not null,

    case_status_id NUMBER (14) not null,

    evidence_pkg_file_name VARCHAR2 (200),

    evidence_pkg_generation_date DATE,

    hearing_date DATE not null,

    record_version NUMBER (9) default 0,

    created_by VARCHAR2 (50) by default of the USER.

    Date_Created DATE default SYSDATE,

    Modified_By VARCHAR2 (50) by default of the USER.

    Date_Modified DATE default SYSDATE,

    POSTED VARCHAR2 (200),

    vehicle_owner_id NUMBER (14).

    hearing_loc_id NUMBER (6).

    evidence_pkg_location_path VARCHAR2 (250)

    )

    History table:

    create the table CASES_H

    (

    case_id NUMBER (14) not null,

    case_number VARCHAR2 (50) not null,

    judgement_date DATE,

    account_ID NUMBER (14) not null,

    case_status_reason_id NUMBER (14) not null,

    case_status_id NUMBER (14) not null,

    evidence_pkg_file_name VARCHAR2 (200),

    evidence_pkg_generation_date DATE,

    hearing_date DATE not null,

    revision_number NUMBER (14) not null,

    record_version NUMBER (9) default 0,

    created_by VARCHAR2 (50) by default of the USER.

    Date_Created DATE default SYSDATE,

    Modified_By VARCHAR2 (50) by default of the USER.

    Date_Modified DATE default SYSDATE,

    POSTED VARCHAR2 (200),

    vehicle_owner_id NUMBER (14).

    hearing_loc_id NUMBER (6).

    evidence_pkg_location_path VARCHAR2 (250)

    )

    Trigger code:

    CREATE OR REPLACE TRIGGER CASE$ H

    AFTER INSERT, DELETE OR UPDATE ON TAG_OWNER. CASE

    REFERENCING OLD AS OLD AGAIN AS NEW

    FOR EACH LINE

    DECLARE

    L_OLD_REV CASES_H.REVISION_NUMBER%TYPE;

    L_CH CASES_H % ROWTYPE;

    L_NEW BOOLEAN;

    BEGIN

    IF DBMS_REPUTIL. FROM_REMOTE = TRUE THEN

    -TRIGGER'S ALREADY SHOT WITH A REMOTE DATABASE

    RETURN; -RELEASE OF THE TRIGGER

    END IF;

    BEGIN

    SELECT MAX (REVISION_NUMBER)

    IN L_OLD_REV

    OF CASES_H

    WHERE CASE_ID = COALESCE(:OLD.) CASE_ID,: NEW. CASE_ID);

    L_OLD_REV: = NVL (L_OLD_REV, 0);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    L_OLD_REV: = 0;

    END;

    CASE

    WHEN INSERTING CAN

    L_CH. ACTION: = "INSERT."

    L_NEW: = TRUE;

    UPDATE THEN

    L_CH. ACTION: = "UPDATE";

    L_NEW: = TRUE;

    ON THE OTHER

    L_CH. ACTION: = "DELETE";

    L_NEW: = FALSE;

    END CASE;

    IF L_NEW THEN

    L_CH. CASE_ID: =: NEW. CASE_ID;

    L_CH. CASE_NUMBER: =: NEW. CASE_NUMBER;

    L_CH. JUDGEMENT_DATE: =: NEW. JUDGEMENT_DATE;

    L_CH. ACCOUNT_ID: =: NEW. ACCOUNT_ID;

    L_CH. CASE_STATUS_REASON_ID: =: NEW. CASE_STATUS_REASON_ID;

    L_CH. CASE_STATUS_ID: =: NEW. CASE_STATUS_ID;

    L_CH. EVIDENCE_PKG_FILE_NAME: =: NEW. EVIDENCE_PKG_FILE_NAME;

    L_CH. EVIDENCE_PKG_GENERATION_DATE: =: NEW. EVIDENCE_PKG_GENERATION_DATE;

    L_CH. HEARING_DATE: =: NEW. HEARING_DATE;

    L_CH. REVISION_NUMBER: = L_OLD_REV;

    L_CH. RECORD_VERSION: =: NEW. RECORD_VERSION;

    L_CH. CREATED_BY: = NVL(:NEW.) CREATED_BY, USER);

    L_CH. DATE_CREATED: = NVL(:NEW.) DATE_CREATED, SYSDATE);

    L_CH. MODIFIED_BY: = NVL(:NEW.) MODIFIED_BY, USER);

    L_CH. DATE_DE_MODIFICATION: = NVL(:NEW.) DATE_MODIFIED, SYSDATE);

    L_CH. POSTED: =: NEW. POSTED;

    L_CH. VEHICLE_OWNER_ID: =: NEW. VEHICLE_OWNER_ID;

    L_CH. HEARING_LOC_ID: =: NEW. HEARING_LOC_ID;

    L_CH. EVIDENCE_PKG_LOCATION_PATH: =: NEW. EVIDENCE_PKG_LOCATION_PATH;

    ON THE OTHER

    L_CH. CASE_ID: =: OLD. CASE_ID;

    L_CH. CASE_NUMBER: =: OLD. CASE_NUMBER;

    L_CH. JUDGEMENT_DATE: =: OLD. JUDGEMENT_DATE;

    L_CH. ACCOUNT_ID: =: OLD. ACCOUNT_ID;

    L_CH. CASE_STATUS_REASON_ID: =: OLD. CASE_STATUS_REASON_ID;

    L_CH. CASE_STATUS_ID: =: OLD. CASE_STATUS_ID;

    L_CH. EVIDENCE_PKG_FILE_NAME: =: OLD. EVIDENCE_PKG_FILE_NAME;

    L_CH. EVIDENCE_PKG_GENERATION_DATE: =: OLD. EVIDENCE_PKG_GENERATION_DATE;

    L_CH. HEARING_DATE: =: OLD. HEARING_DATE;

    L_CH. REVISION_NUMBER: = L_OLD_REV;

    L_CH. RECORD_VERSION: =: OLD. RECORD_VERSION;

    L_CH. CREATED_BY: = NVL(:OLD.) CREATED_BY, USER);

    L_CH. DATE_CREATED: = NVL(:OLD.) DATE_CREATED, SYSDATE);

    L_CH. MODIFIED_BY: = NVL(:OLD.) MODIFIED_BY, USER);

    L_CH. DATE_DE_MODIFICATION: = NVL(:OLD.) DATE_MODIFIED, SYSDATE);

    L_CH. POSTED: =: OLD. POSTED;

    L_CH. VEHICLE_OWNER_ID: =: OLD. VEHICLE_OWNER_ID;

    L_CH. HEARING_LOC_ID: =: OLD. HEARING_LOC_ID;

    L_CH. EVIDENCE_PKG_LOCATION_PATH: =: OLD. EVIDENCE_PKG_LOCATION_PATH;

    END IF;

    L_CH. REVISION_NUMBER: = L_OLD_REV + 1;

    -Insert in the history table

    INSERT INTO L_CH VALUES CASES_H;

    END CASE$ H;

    I get the error below

    Component 'ACTION' must be declared

    Component 'ACTION' must be declared

    Component 'ACTION' must be declared

    Try to find what exactly could be the problem but hard of luck so far.

    Ask for help.

    THX

    Shan!

    You define l_ch as cases_h % rowtype. The cases_h table doesn't have a column 'action', yet in three places, that you try to give a value to l_ch.action. l_ch.action is not defined, as the compiler points out.

    So either use a different flag (similar to what you are doing with l_new), or change your historical table and add a column of action.

  • PLS-00201: identifier 'NVL2' must be declared.

    I came across a scenario where I saw that NVL2 is a PL/SQL function, but when I tried to use this function directly with plsql variable it gives me error. Although it is find a job within SQL.

    Here is the example I'm writing his strange behavior I see.

    I'm under banner PL/SQL Release 11.2.0.4.0 - Production

    SQL> --See when we use NVL2 within SQL it works fine
    SQL> select nvl2('IamNotNull', 'IamForNotNull', 'IamForNull') for_not_null
      2            ,nvl2(null, 'IamForNotNull', 'IamForNull') for_null
      3  from dual;
    
    
    FOR_NOT_NULL  FOR_NULL
    ------------- ----------
    IamForNotNull IamForNull
    
    
    SQL> --Problem occurs when we assign the resultant directly into variable in anonymous block
    SQL> declare
      2      for_not_null varchar2(200);
      3  begin
      4      for_not_null :=NVL2('IamNotNull', 'IamForNotNull', 'IamForNull');
      5  end;
      6  /
        for_not_null :=NVL2('IamNotNull', 'IamForNotNull', 'IamForNull');
                       *
    ERROR at line 4:
    ORA-06550: line 4, column 20:
    PLS-00201: identifier 'NVL2' must be declared
    ORA-06550: line 4, column 5:
    PL/SQL: Statement ignored
    
    
    
    
    SQL>
    

    Spear says:

    But I had look at Oracle self-documenting and it was not clear that NVL2 is SQL fucntion.

    Weird, because I just searched documentation, and the first that says NVL2 in the context of the PL/SQL language was all NVL2 hits were either programming language SQL or OLAP expression reference: http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/fundamentals.htm#LNPLS00212

    which clearly states that the NVL2 is not available in PL/SQL.

  • PLS-00201: identifier 'i' must be declared when using BULK COLLECT with FORALL to insert data in 2 tables?

    iHi.

    Declare
       cursor c_1
       is
        select col1,col2,col3,col4
        from table1
    
    
       type t_type is table of c_1%rowtype index by binary_integer;
       v_data t_type;
    BEGIN
       OPEN c_1;
       LOOP
          FETCH c_1 BULK COLLECT INTO v_data LIMIT 200;
          EXIT WHEN v_data.COUNT = 0;
          FORALL i IN v_data.FIRST .. v_data.LAST
             INSERT INTO xxc_table
               (col1,
                col3,
                col4
               )
                SELECT v_data (i).col1,
                       v_data (i).col3,
                       v_data (i).col4
                  FROM DUAL
                 WHERE NOT EXISTS
                              (SELECT 1
                                 FROM xxc_table a
                                WHERE col1=col1
                                      .....
                              );
                         --commit;
             INSERT INTO xxc_table1
               (col1,
               col2,
              col3,
              col4
               )
                SELECT v_data (i).col1,
                       v_data (i).col2,
                       v_data (i).col3,
                       'Y'
                  FROM DUAL
                 WHERE NOT EXISTS
                              (SELECT 1
                                 FROM xxc_table1 a
                                WHERE col1=col1
          .....
         );
    
    
           --exit when c_1%notfound;
       END LOOP;
       CLOSE c_1;
       commit;
    END;
    
    
    
    
    
    
    
    

    I get 40/28-PLS-00201: identifier 'I' must be declared what the problem in the above code please help me and I have lakhs of data

    Thank you

    Post edited by: Rajesh123 I changed IDX

    Post edited by: Rajesh123 changed t_type c_1 in Fetch

    But by using a SET of INSERT to insert into two tables at once in the same query would do the job without any collection of bulk of PL and avoid to query two times too.

    for example, as a single INSERT...

    SQL > create table table1 as
    2. Select 1 as col1, col2 of 1, 1 as col3, 1 as col4 Union double all the
    3 select 2,2,2,2 of all the double union
    4 Select 3,3,3,3 Union double all the
    5 Select 4,4,4,4 of all the double union
    6 select 5,5,5,5 of all the double union
    7 select 6,6,6,6 of all the double union
    8 select 7,7,7,7 of all the double union
    9 select 8,8,8,8 of all the double union
    10. Select 9,9,9,9 to the Union double all the
    11. Select double 10,10,10,10
    12.

    Table created.

    SQL > create table xxc_table like
    2. Select 1 as col1, col3 2, 3 as col4 Union double all the
    3. Select the 3, 4, 5 Union double all the
    4. Select the 5, 6, 7 double
    5.

    Table created.

    SQL > create table xxc_table1 like
    2. Select 3 as col1, col2, col3, 5 4 "n" as col4 Union double all the
    3. Select the 6, 7, 8, double "n"
    4.

    Table created.

    SQL > insert all
    2 when the xt_insert is null then
    3 in xxc_table (col1, col3, col4)
    4 values (col1, col3, col4)
    5 when the xt1_insert is null then
    6 in xxc_table1 (col1, col2, col3, col4)
    7 values (col1, col2, col3, 'Y')
    8. Select t1.col1 t1.col2, t1.col3, t1.col4
    9, xt.col1 as xt_insert
    10, xt1.col1 as xt1_insert
    11 from table1 t1
    12 left join external xxc_table xt (t1.col1 = xt.col1)
    13 left xt1 xxc_table1 outer join (t1.col1 = xt1.col1)
    14.

    15 rows created.

    SQL > select * from xxc_table by 1.
    COL1 COL3 COL4
    ---------- ---------- ----------
    1          2          3
    2          2          2
    3          4          5
    4          4          4
    5          6          7
    6          6          6
    7          7          7
    8          8          8
    9          9          9
    10-10-10

    10 selected lines.

    SQL > select * from xxc_table1 by 1.

    COL1 COL2 COL3 C
    ---------- ---------- ---------- -
    1          1          1 Y
    2          2          2 Y
    3          4          5 N
    4          4          4 Y
    5          5          5 Y
    6          7          8 N
    7          7          7 Y
    8          8          8 Y
    9          9          9 Y
    10-10-10

    10 selected lines.

    SQL >

Maybe you are looking for

  • Accidentally partitioned my boot drive.

    Thinking I was partition an external drive, I partitioned my boot drive of 1 gig in 3 equal partitions. Things seem to be good, but is it possible to easily disable partition or do I have to reformat the hard disk and reinstall from my backup time ma

  • Signature with password by accident...

    Accidentally put in password when entering my email address - now I see whenever I connect - how to remove? Deleting does nothing... just put in the first letters evokes several 'suggestions'... that's what I can't get rid of - help please!

  • Decision SSD clearly, but TRIM gray?

    Hello I just downloaded the new dashboard Sandisk SSD. It seems TRIM for my extreme II SSD optimization is gray, although the security status of the drive should be clear (or at least, I saw not a clue showing that it is defined otherwise). Is this a

  • Windows Vista Service Pack 2: Compatible blue screens

    Hello. I tried to debug my friends computer. He had regular blue screens of death. I analyzed the dump files and it turned out that he had bad memory in the first 2 crashes (it linked several times windows memory diagnostic tool and even swap ram slo

  • How to get the Version of Blackberry Messenger in webworks

    I would like to know if its possible for me to get the version of Blackberry Messenger installed on Blackbery device from my application webworks. I need to know how to do that because I intend to connect my blackberry webworks for BBM 6 application.