ORA-01410: invalid ROWID, when procedure is executed

Hi,
I am using Oracle 10g 10.2.0.3 on linux 64 bit
I am getting following error
ORA-12012: error on auto execute of job 17069
ORA-01410: invalid ROWID
ORA-06512: at "t1.DR1", line 12
ORA-06512: at line 1
t1 is the schema and DR1 is the procedure run every hour
Error in Alert log showing thirce time.
Following is the content of procedure
create or replace procedure t1.dr1
is
CURSOR CS1
IS
select * FROM t1.V_TL_DR1;
begin
FOR CURRENT_RECORD IN CS1
LOOP
begin
insert into t1.tr_dr1
values
(t1.tr_dr1_seq.nextval,CURRENT_RECORD.uuid,default,'ANY',DEFAULT,NULL,NULL,NULL,null);
if CURRENT_RECORD.dv_code in('SD1','SD2') then
INSERT INTO t1.dr1_writer
values
(t1.dr1_writer_feed_seq.nextval,CURRENT_RECORD.uuid,'OP1',DEFAULT,NULL,DEFAULT,NULL,null,DEFAULT,NULL);
else
INSERT INTO t1.dr1_writer
values
(t1.dr1_writer_feed_seq.nextval,CURRENT_RECORD.uuid,'OP2',DEFAULT,NULL,DEFAULT,NULL,null,DEFAULT,NULL);
end if;
exception
WHEN DUP_VAL_ON_INDEX then
dbms_output.put_line('IT IS NOT ALLOWED TO DUPLICATE');
end;
END LOOP;
end;
t1.V_TL_DR1 IS a view which has two columns uuid and dv_code
Could any one tell me that, is it something to do with above procedure

CREATE OR REPLACE VIEW t1.V_TL_DR1 AS
select distinct ap.uuid uuid,ap.adv_code adv_code
from
     (select alj.app_uid app_uid,alj.stages_uid stages_uid
     ,max(rate_AB) RATE_AB
     ,max(rate_Ac) RATE_AC
     ,max(rate_AD) RATE_AD
     ,MAX(CREATED) CREATED
     from t1.aof alj, (select max(uuid) uuid,max(in_name) in_name from t1.stages where stage=50 group by app_uid) st2
     where alj.stages_uid=st2.uuid
     group by alj.app_uid,alj.stages_uid) alj
     ,t1.app ap
     ,t1.app_user appu
     ,(select * from t1.app_applicant where joint='P') applicants
          WHERE
          alj.app_uid=ap.uuid
          and ap.user_uid=appu.uuid
          and ap.uuid=applicants.app_uid(+)
          and alj.created between systimestamp-(30/1440) and systimestamp-(10/1440)
          and ap.app_status='N'
          and
          (RATE_AB is not null and RATE_AB<>0)
          OR (RATE_AC not null and RATE_AC<>0)
          OR (RATE_AD is not null and RATE_AD<>0 and applicants.residential_status not in('T','U'))
          and appu.role='WEB'
          and ap.created between systimestamp-90 and systimestamp
          and ap.adv_code not in('UP1','UP2','UP3','UP4')Edited by: user605066 on 21-Feb-2011 02:32
Edited by: user605066 on 21-Feb-2011 02:35

Similar Messages

  • Local Domain Index  query fails with ora-01410: invalid rowid

    Hello!
    I have a task to implement partitioned domain index for range partitioned table.
    As I understood from reference http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/dom_idx.htm
    the main difference is to provide support for partitioning operations by
    implementing corresponding ODCI interface functions.
    For the first I decided to create something simple to not spend time on system partitioned
    index storage table. My problem is that domain index works correctly when it's created without
    support for partitioning and produces "*ORA-01410: INVALID ROWID*" when it's created
    with LOCAL option.
    Test query:
    SELECT /* +index(from_sample_index) */ * FROM index_in_partitioned_tbl WHERE position_between(card_no)  < 50 ORDER BY card_no DESC;
    Index creared in this way returns 3 rows:
    CREATE INDEX from_sample_index ON index_in_partitioned_tbl (card_no) INDEXTYPE IS position_indextype;
    When index has been creared with LOCAL option I got "ORA-01410: INVALID ROWID" :
    CREATE INDEX from_sample_index ON index_in_partitioned_tbl (card_no) INDEXTYPE IS position_indextype LOCAL;
    I don't post implementation's source code to reduce amount of text in post. It works for global index.
    If I copy rowid from index storage table and then put it into something like
    SELECT card_no FROM index_in_partitioned_tbl WHERE rowid = 'AAAXHGAAEAAAFERAAh';
    then it will be executed successfully without any errors.
    I suppose the error could be somehow linked with "alter index" calls that Oracle makes when local domain index is created.
    The calls are made with option "AlterIndexRebuild" - possibly they mark index as invalid (though it's shown as valid in SQL Developer)

    Solved :)
    when index is LOCAL calls for ODCIINDEXSTART - ODCIINDEXFETCH - ODCIINDEXCLOSE are executed for each partition of base table.
    In my case ODCIINDEXFETCH returns row_id's regardless of partition that are currently scanned for values. So first call returned rowid values for all partitions not only for the first partition and validation failed with "ora-01410: invalid rowid"

  • Raise Form_Trigger_Failure on When-Button-Pressed  ORA-01410 Invalid RowID

    Hello to all...
    I have an error whit Raise Form_Trigger_Failure on trigger When-Button-Pressed.
    I guess the error is when does the Raise Form_Trigger_Failure
    When validate something, this validation ask me if i want to continue.
    When i answer NO, give me this error: ORA-01410 Invalid RowID
    If i answer YES, the process continue and in an unexpected moment, give that error too
    Why give me that error?
    How can i resolve this error...help me
    thanks...
    Part of Code
    FOR i IN 1..TItemsAsi1.LAST LOOP
    IF TItemsAsi1(i).c_error IS NOT NULL THEN
    l_error := l_error + 1;
    IF TItemsAsi1(i).c_error = 'ND' THEN
    IF NOT Fpa_mensaje.disp_consulta_sino('Atención','No hay datos suficientes para generar Asiento de cierre relacionado a Reconocimiento de los recursos del ejercicio') THEN           
    RAISE FORM_TRIGGER_FAILURE;
    END IF ;     ELSIF TItemsAsi1(i).c_error = 'AD' THEN
    IF NOT Fpa_mensaje.disp_consulta_sino('Atención','Hay cuentas Acreedoras con saldo Deudor CUENTA: '||TItemsAsi1(i).c_cuenta||'. ¿Desea continuar con el cierre? ') THEN           
    RAISE FORM_TRIGGER_FAILURE;
    END IF ;     ELSIF TItemsAsi1(i).c_error = 'DA' THEN
    IF NOT Fpa_mensaje.disp_consulta_sino('Atención','Hay cuentas Deudoras con saldo Acreedor CUENTA:'||TItemsAsi1(i).c_cuenta||'. ¿Desea continuar con el cierre? ') THEN           
    RAISE FORM_TRIGGER_FAILURE;
    END IF ;     END IF;END IF;END LOOP;

    delete from <table> where rowid like '<block id>%'Arrgh. To be honest, this is the worst sql-statement i have seen this year. i hope the statement will raise an error on execution, but even if it would get executed, what should be the reason for something like this? Delete anything which is stored in a specific block, regardless of the meaning ?

  • Help to Identify the peace of code Causing - ORA-01410: invalid ROWID

    Hi I have Plsql Block that runs monthly and process 10 million records and every once in a while it fails with the ORA-01410: invalid ROWID Error ,last month it failed two times with same error ,if any one could point me what is wrong this code ,i will work on it to fix. if you see the code we have exceptio n block at the end of the code ,we have procedure that inserts a record into log table ,so both the failures had inserted a record into the table that means it failed before it entered into for loop.
    my question is can Fech statement cause invalid rowid.
    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
    DECLARE
      cFetchLimit CONSTANT NUMBER := 100000; 
      nRunningTotal NUMBER := 0;
      CURSOR curRawData IS
          SELECT rawdata.*, SYS_GUID() combinedprofitdataid,
               NVL((SELECT 'Y'    
                    FROM   SNAP_CDS_HR_NONSENSITIVE_DATA
                    WHERE  emplid = LPAD(rawdata.fk_westprireltnshpmanagerempid,11,'0')),'N') hrempexists,
               NVL((SELECT MAX('Y')      
                    FROM   SNAP_MAX_Entity
                    WHERE  AU     = DECODE(LENGTH(REPLACE(TRANSLATE(rawdata.fk_west_bookingau, '0123456789' ,'**********'), '*', NULL)), NULL, rawdata.fk_west_bookingau, NULL) 
                    ),'N') bookingauexists,               
               NVL((SELECT  MAX('Y')
                    FROM   SNAP_MAX_Entity
                    WHERE  AU     = DECODE(LENGTH(REPLACE(TRANSLATE(rawdata.fk_westprireltnshpmanagerempau, '0123456789' ,'**********'), '*', NULL)), NULL, rawdata.fk_westprireltnshpmanagerempau, NULL)
                    ),'N') prirelmanempauexists,
               NVL((SELECT  MAX('Y')          
                    FROM   SNAP_MAX_ProductGroup
                    WHERE  ProductGroupId = DECODE(LENGTH(REPLACE(TRANSLATE(rawdata.fk_west_productgroupid, '0123456789' ,'**********'), '*', NULL)), NULL, rawdata.fk_west_productgroupid, NULL)
                    ),'N') productgroupexists,
               NVL((SELECT  MAX('Y')          
                    FROM   SNAP_MAX_Product
                    WHERE  ProductId = rawdata.fk_west_productid
                    ),'N') productidexists,
               NVL((SELECT  MAX('Y')
                    FROM   SNAP_MAX_SubProduct
                    WHERE  SubProductId = rawdata.fk_west_subproductid
                    ),'N') subproductidexists,
               (SELECT  e.GL_ENTITY       
                        FROM SNAP_CDS_HR_NONSENSITIVE_DATA e
                       WHERE e.emplid = LPAD(rawdata.fk_westprireltnshpmanagerempid,11,'0')
                         AND e.AU = rawdata.FK_WESTPRIRELTNSHPMANAGEREMPAU ) entity_fk_westprirelmanempau
        FROM   T_rawdata rawdata
        WHERE rawdata.dda_flag = 'N';
      TYPE RawData_aat IS TABLE OF curRawData%ROWTYPE INDEX BY PLS_INTEGER;
      l_RawData RawData_aat;   
      TYPE CombinedProfitData_aat IS TABLE OF T_WIS_CDS_COMBINEDPROFITDATA%ROWTYPE INDEX BY PLS_INTEGER;
      l_CombinedP CombinedProfitData_aat;
      cpdIdx NUMBER := 0;
      vcHREmpExists          VARCHAR2(1) := 'N';
      vcBookingAuExists      VARCHAR2(1) := 'N';
      vcPriRelManEmpAuExists VARCHAR2(1) := 'N';
      vcProductGroupExists   VARCHAR2(1) := 'N';
      vcProductIDExists      VARCHAR2(1) := 'N';
      vcSubProductIDExists   VARCHAR2(1) := 'N';
      vcBEIDExists           VARCHAR2(1) := 'N';
      l_raw_accountnum           t_wis_cds_h_act_rawdata.account%TYPE                   := NULL;
      l_raw_bank_id              t_wis_cds_h_act_rawdata.account%TYPE                   := NULL;
      l_west_sourcesystem        t_wis_cds_h_act_rawdata.sourcesystem%TYPE              := NULL;
      l_fnd_combinedprofitdataid T_WIS_CDS_COMBINEDPROFITDATA.combinedprofitdataid%TYPE := NULL;
      FUNCTION BEIDExists(p_west_be_id VARCHAR2) RETURN VARCHAR2 IS
        CURSOR curBEIDData IS
          SELECT 'Y'
          FROM   SNAP_STOBEX_BUSINESS_ENTITY
          WHERE  be_id  = p_west_be_id;
      BEGIN     
        FOR recBEIDData IN curBEIDData LOOP
          RETURN 'Y';
        END LOOP;
        RETURN 'N';   
      EXCEPTION
      WHEN OTHERS THEN
         P_WIS_CDS.LOG('exists', SQLCODE, SQLERRM);
        RETURN 'N'; 
      END BEIDExists;  
    BEGIN
      OPEN curRawData;
      LOOP
        FETCH curRawData BULK COLLECT INTO l_RawData LIMIT cFetchLimit;
        EXIT WHEN l_RawData.COUNT = 0;       
        l_CombinedP.DELETE;
        cpdIdx := 0;
        nRunningTotal := nRunningTotal + l_RawData.COUNT;
        P_WIS_CDS.info('Merge_cp','0', 'Processing '||nRunningTotal||' rows @ '||SYSDATE);
        FOR i IN l_RawData.FIRST..l_RawData.LAST LOOP
            cpdIdx := (cpdIdx+1);       
            vcHREmpExists          := 'N';
            vcBookingAuExists      := 'N';
            vcPriRelManEmpAuExists := 'N';
            vcProductGroupExists   := 'N';
            vcProductIDExists      := 'N';
            vcSubProductIDExists   := 'N';
            vcBEIDExists           := 'N';
            l_CombinedP(cpdIdx).exportsource      := l_RawData(i).exportsource;
            l_CombinedP(cpdIdx).exportsourcetype  := l_RawData(i).exportsourcetype;
            l_CombinedP(cpdIdx).fk_exportsourceid := l_RawData(i).exportsourceid;
            IF l_RawData(i).fk_westprireltnshpmanagerempid IS NOT NULL THEN
              l_CombinedP(cpdIdx).fk_westprireltnshpmanagerempid :=
                                          LPAD(l_RawData(i).fk_westprireltnshpmanagerempid, 11, '0');       
            ELSE
              l_CombinedP(cpdIdx).fk_westprireltnshpmanagerempid := NULL;
            END IF;
            l_CombinedP(cpdIdx).fk_west_productgroupid :=
                                                l_RawData(i).fk_west_productgroupid;  
            l_CombinedP(cpdIdx).fk_west_productid      :=
                                                     l_RawData(i).fk_west_productid;
            l_CombinedP(cpdIdx).fk_west_subproductid   :=
                                                  l_RawData(i).fk_west_subproductid;
            l_CombinedP(cpdIdx).fk_west_bookingau := NULL;
            IF l_RawData(i).fk_westprireltnshpmanagerempau IS NOT NULL OR l_RawData(i).fk_westprireltnshpmanagerempau <> '0' THEN
         l_CombinedP(cpdIdx).fk_westprireltnshpmanagerempau :=
                                     lpad(l_RawData(i).fk_westprireltnshpmanagerempau,7,'0');   ---->751 task
         ELSE
         l_CombinedP(cpdIdx).fk_westprireltnshpmanagerempau := NULL;
         END IF;         
            l_CombinedP(cpdIdx).combinedprofitdataid         := l_RawData(i).combinedprofitdataid; ---SYS_GUID();
            l_CombinedP(cpdIdx).exportsource                 := l_RawData(i).exportsource;
            l_CombinedP(cpdIdx).exportsourcetype             := l_RawData(i).exportsourcetype;
            l_CombinedP(cpdIdx).fk_exportsourceid            := l_RawData(i).exportsourceid;
            l_CombinedP(cpdIdx).endofmonthdate               := l_RawData(i).endofmonthdate;
            l_CombinedP(cpdIdx).account                      := l_RawData(i).account;
            l_CombinedP(cpdIdx).westaccount                  := l_RawData(i).westaccount;
         IF l_RawData(i).westaccount IS NOT NULL
         THEN
              l_CombinedP(cpdIdx).iseastaccountconvertedtowest := 'Y';
         END IF;
                BEGIN
                  SELECT customer.WEST_BE_ID,
                         linkage.parent_id,
                         linkage.top_parent_id
                  INTO   l_CombinedP(cpdIdx).fk_west_be_id,
                         l_CombinedP(cpdIdx).fk_west_ber_id,
                         l_CombinedP(cpdIdx).fk_west_hlber_id
                  FROM   SNAP_STOBEX_BE_BER_LINKAGE linkage,
                         T_EastToWest customer
                  WHERE  customer.east_customerid = l_RawData(i).fk_customerid
                  AND    customer.east_accountid  = NVL(l_RawData(i).westaccount,l_RawData(i).account)
                  AND    linkage.entity_id(+)     = customer.west_be_id
                  AND    linkage.entity_type(+)   = 'BE'
                  AND    ROWNUM                   = 1;
                EXCEPTION
                WHEN NO_DATA_FOUND THEN
                  BEGIN
                    SELECT customer.WEST_BE_ID,
                           linkage.parent_id,
                           linkage.top_parent_id
                    INTO   l_CombinedP(cpdIdx).fk_west_be_id,
                           l_CombinedP(cpdIdx).fk_west_ber_id,
                           l_CombinedP(cpdIdx).fk_west_hlber_id
                    FROM   SNAP_STOBEX_BE_BER_LINKAGE linkage,
                           T_EastToWest customer
                    WHERE  customer.east_customerid = l_RawData(i).fk_customerid
                    AND    customer.east_accountid  = l_RawData(i).account
                    AND    linkage.entity_id(+)     = customer.west_be_id
                    AND    linkage.entity_type(+)   = 'BE'
                    AND    ROWNUM                   = 1;
                  EXCEPTION            
                    WHEN OTHERS THEN                           
                     l_CombinedP(cpdIdx).fk_west_be_id    := NULL;
                     l_CombinedP(cpdIdx).fk_west_ber_id   := NULL;
                     l_CombinedP(cpdIdx).fk_west_hlber_id := NULL;
                  END;
                WHEN OTHERS THEN                           
                  l_CombinedP(cpdIdx).fk_west_be_id    := NULL;
                  l_CombinedP(cpdIdx).fk_west_ber_id   := NULL;
                  l_CombinedP(cpdIdx).fk_west_hlber_id := NULL;
                END;
            l_fnd_combinedprofitdataid := NULL;
            BEGIN
                SELECT  COMBINEDPROFITDATAID
                  INTO l_fnd_combinedprofitdataid
                  FROM T_WIS_CDS_COMBINEDPROFITDATA cpd
                 WHERE cpd.fk_west_be_id                   = l_CombinedP(cpdIdx).fk_west_be_id
                   AND cpd.fk_west_productgroupid          = l_CombinedP(cpdIdx).fk_west_productgroupid
                   AND cpd.fk_west_productid               = l_CombinedP(cpdIdx).fk_west_productid
                   AND cpd.fk_west_subproductid            = l_CombinedP(cpdIdx).fk_west_subproductid
                   AND extract(month from cpd.endofmonthdate)   = extract(month from l_CombinedP(cpdIdx).endofmonthdate)
                   AND extract(year from cpd.endofmonthdate) = extract(year from l_CombinedP(cpdIdx).endofmonthdate) 
                   AND cpd.revenue BETWEEN l_CombinedP(cpdIdx).revenue - 10.00 AND l_CombinedP(cpdIdx).revenue + 10.00               
                   AND cpd.exportsource <> 'CP'
                   AND ROWNUM = 1;
            EXCEPTION
              WHEN NO_DATA_FOUND THEN
                l_fnd_combinedprofitdataid := NULL;
              WHEN OTHERS THEN
                l_fnd_combinedprofitdataid := NULL;
            END;
            IF l_fnd_combinedprofitdataid IS NOT NULL THEN
              l_CombinedP(cpdIdx).isduplicate       := 'Y';
              l_CombinedP(cpdIdx).fk_duplicatecpdid := l_fnd_combinedprofitdataid;         
            ELSE
              l_CombinedP(cpdIdx).isduplicate       := 'N';
              l_CombinedP(cpdIdx).fk_duplicatecpdid := NULL;
            END IF;
            l_CombinedP(cpdIdx).iserror      := 'N';
            l_CombinedP(cpdIdx).errormessage := NULL;   
         IF l_CombinedP(cpdIdx).FK_WESTPRIRELTNSHPMANAGEREMPAU IS NULL AND l_CombinedP(cpdIdx).ENTITY_FK_WESTPRIRELMANEMPAU IS NOT NULL THEN
              l_CombinedP(cpdIdx).iserror      := 'Y';
              IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('FK_WESTPRIRELTNSHPMANAGEREMPAU is NULL but Entity value exists. ')) < 250 THEN
                l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'FK_WESTPRIRELTNSHPMANAGEREMPAU is NULL but Entity value exists. ';
              END IF;
            END IF;
            IF l_CombinedP(cpdIdx).fk_westprireltnshpmanagerempid IS NULL AND
              l_RawData(i).primaryrelationshipmanagerid IS NOT NULL THEN
              l_CombinedP(cpdIdx).iserror      := 'Y';
              IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Missing CP RM/EMP ID translation. ')) < 250 THEN
                l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Missing CP RM/EMP ID translation. ';
              END IF;                             
            ELSE               
              vcHREmpExists := l_RawData(i).HREmpExists;
              IF vcHREmpExists <> 'Y' THEN
                l_CombinedP(cpdIdx).iserror      := 'Y';
                IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Invalid CP RM/Emp ID translation. ')) < 250 THEN
                  l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Invalid CP RM/Emp ID translation. ';
                END IF;
              END IF;
            END IF;
            IF l_CombinedP(cpdIdx).fk_westprireltnshpmanagerempau IS NULL AND
              l_RawData(i).primaryrelationshipmanagerau IS NOT NULL THEN
              l_CombinedP(cpdIdx).iserror      := 'Y';
              IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Missing CP RM/EMP AU reference. ')) < 250 THEN
                l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Missing CP RM/EMP AU reference. ';
              END IF;       
            END IF;
            vcPriRelManEmpAuExists := l_RawData(i).PriRelManEmpAuExists;      
            IF vcBookingAuExists <> 'Y' THEN
              l_CombinedP(cpdIdx).iserror      := 'Y';
              IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Invalid CP RM/Emp AU translation. ')) < 250 THEN
                l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Invalid CP RM/Emp AU translation. ';
              END IF;
            END IF;
            IF l_CombinedP(cpdIdx).fk_west_productgroupid IS NULL THEN
              l_CombinedP(cpdIdx).iserror      := 'Y';
              IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Missing CP Product Group translation. ')) < 250 THEN
                l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Missing CP Product Group translation. ';
              END IF;
            ELSE
              vcProductGroupExists := l_RawData(i).ProductGroupExists;      
              IF vcProductGroupExists <> 'Y' THEN
                l_CombinedP(cpdIdx).iserror      := 'Y';
                IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Invalid CP Product Group translation. ')) < 250 THEN
                  l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Invalid CP Product Group translation. ';
                END IF;
              END IF;
            END IF;
            IF l_CombinedP(cpdIdx).fk_west_productid IS NOT NULL THEN
              vcProductIdExists := l_RawData(i).ProductIdExists;      
              IF vcProductGroupExists <> 'Y' THEN
                l_CombinedP(cpdIdx).iserror      := 'Y';
                IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Invalid CP Product translation. ')) < 250 THEN
                  l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Invalid CP Product translation. ';
                END IF;
              END IF;
            END IF;
            IF l_CombinedP(cpdIdx).fk_west_subproductid IS NOT NULL THEN
              vcSubProductIdExists := l_RawData(i).SubProductIdExists;      
              IF vcSubProductIdExists <> 'Y' THEN
                l_CombinedP(cpdIdx).iserror      := 'Y';
                IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Invalid CP Sub Product translation. ')) < 250 THEN
                  l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Invalid CP Sub Product translation. ';
                END IF;
              END IF;
            END IF;
            IF l_CombinedP(cpdIdx).fk_west_be_id IS NULL THEN
              l_CombinedP(cpdIdx).iserror      := 'Y';
              IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Missing CP BE ID translation. ')) < 250 THEN
                l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Missing CP BE ID translation. ';
              END IF;
            ELSE
              vcBEIDExists := BEIDExists(l_CombinedP(cpdIdx).fk_west_be_id);      
              IF vcBEIDExists <> 'Y' THEN
                l_CombinedP(cpdIdx).iserror      := 'Y';
                IF (LENGTH(NVL(l_CombinedP(cpdIdx).errormessage,0))+LENGTH('Invalid CP BE ID translation. ')) < 250 THEN
                  l_CombinedP(cpdIdx).errormessage := l_CombinedP(cpdIdx).errormessage||'Invalid CP BE ID translation. ';
                END IF;
              END IF;
            END IF;
        END LOOP;
        FORALL i in l_CombinedP.FIRST..l_CombinedP.LAST
          INSERT INTO T_WIS_CDS_COMBINEDPROFITDATA 
          VALUES l_CombinedP(i);
       COMMIT;  
      END LOOP;
      CLOSE curRawData;
    COMMIT; 
    EXCEPTION
    WHEN OTHERS THEN
      IF curRawData%ISOPEN THEN
        CLOSE curRawData;
      END IF;
       P_WIS_CDS.LOG('Error', SQLCODE, SQLERRM);
    END;
    /Thank you

    I just looked at all the ddls' i have the following syntax for all MV's
    CREATE MATERIALIZED VIEW WIS.SNAP_MAX_ENTITY
    TABLESPACE WIS_CDS_DATA01
    PCTUSED    0
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          80K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    USING INDEX
                TABLESPACE WIS_DATA01
                PCTFREE    10
                INITRANS   2
                MAXTRANS   255
                STORAGE    (
                            INITIAL          80K
                            NEXT             80K
                            MINEXTENTS       1
                            MAXEXTENTS       UNLIMITED
                            PCTINCREASE      0
                            FREELISTS        1
                            FREELIST GROUPS  1
                            BUFFER_POOL      DEFAULT
    REFRESH FORCE ON DEMAND
    WITH PRIMARY KEYEdited by: vijayp on Aug 7, 2012 6:44 PM
    Edited by: vijayp on Aug 7, 2012 7:02 PM

  • ORA-01410: invalid ROWID

    I was trying to load data into a table using SQL Loader
    when I came across this error in the log file . I am not sure what might have happened or where to look to fix this up. Any ideas or suggestions as to where to look? I am on Oracle 9.2.0.4 on unix(AIX 4.3)
    Thanks
    insert into med.orders a
    ERROR at line 1:
    ORA-01410: invalid ROWID

    My control file is as follows :
    load data
    append
    into table orders
    fields terminated by '|'
    (disc_telephone_number,
    order_number,
    due_date,
    completion_date,
    status,
    ocn,
    region CONSTANT "TOC",
    pon,
    start_date,
    start_time,
    technician,
    phone_number,
    actual_time)
    Actually my shell script does some updates and then inserts records into the table using sqlldr.
    First the updates which works fine...but during insert, it just hangs.
    1260 rows updated.
    Commit complete.
    It was supposed to do the insert and then again commit. (About 2500 records),,,but should take only about 20 minutes...(i compared this to my 8i environment.)But it just sits there, and when I cancel after a long gap of time it gives me the ORA error message saying
    Insert into orders ( .........)
    User requested cancel of operation
    Any suggestions ? Thanks

  • ORA-01410 Invalid RowID. Help me..

    Hi,
    I'm getting ORA-01410 error while trying to backup table X.
    (table X has no indexes.)
    what i did..
    1) using exp... --> ORA-01410 error
    2) create table X2 as select * from X --> ORA-01410 error
    3) alter table X move tablespace T2 --> ORA-01410 error
    4) analyze table X validate structure cascade --> ORA-01410 error
    maybe corruption?
    what i did next..
    1) fsck --> OK
    2) dbv file=XXX BLOCKSIZE=8192 (all datafiles) -> OK
    3) dbms_repair.check_object(...) -> OK
    i cannot understand this case.
    it's not the case of index corruption or "current of" bug.
    My environment is...
    - OS : Fedora Core 4
    - DB : Oracle 9.2.0.8 for Linux
    Can somebody tell me how i should repair this table?

    Table size is 4,197,449,728 (about 4GB) and 512,384 blocks (1block = 8KB)
    as I mentioned before, create as select statement was failed.
    at the view "v$longops" ,
    I can see progress of full scanning..
    from 0 block to 451341 block...
    but, there the ORA-01410 error is raised.

  • ORA-10722 Invalid Number when trying to Associate Asset to Activity

    Hello experts,
    For Activities created by API, we are getting an error (ORA-10722 Invalid Number) when attempting to associate a asset to the activity using the activity Association Form. Has anyone run across this before?
    Thanks,
    Tom

    ORA-01722: invalid number
    It can be because of The attempted conversion of a character string to a number failed because the character string was not a valid numeric literal.
    Only numeric fields or character fields containing numeric data may be used in arithmetic functions or expressions.
    Only numeric fields may be added to or subtracted from dates.
    Check the character strings in the function or expression.
    Check that they contain only numbers, a sign, a decimal point, and the character "E" or "e" and retry the operation .
    Check API design.
    Regards
    Kamal

  • ORA-00900: invalid SQL statement Error while Executing Procedure

    Hi:
    I am trying to execute following procedure through java code, but i am getting ORA-00900: invalid SQL statement error.
    Procedure is :
    <code>
    (vResult out int)
    as
    vCardId varchar2(16);
    vForacid varchar2(16);
    vApp_Entry_No varchar2(10);
    vSrNo number(6);
    vCardStatus char(1);
    vCardStat char(2);
    vExpiryDate date;
    Cursor cardCur1 is
    select u.card_number,trim(u.ACCOUNT_NUMBER),u.CARD_STATUS,to_char(u.EXPIRY_DATE,'dd-MM-yyyy')
    FROM DailyCardData u
    where default_indicator='1'
    and isprocessed = 'N'
    order by expiry_date;
    begin
    vSrNo := 0;
    vResult := 0;
    open cardCur1;
    Loop
    fetch cardCur1 into vCardId,vForacid,vCardStat,vExpiryDate;
    if cardCur1%NOTFOUND then
    exit;
    end if;
    if (vCardStat != null) then
    vCardStatus := 'H';
    elsif (vExpiryDate <= sysdate) then
    vCardStatus := 'E';
    else
    vCardStatus := null;
    end if;
    select a.app_entry_no into vApp_Entry_No from Application a,ApplicationLinkedAccounts l
    where l.foracid = vForacid and l.AcSrNo = '1'
    and a.app_entry_no = l.app_entry_no
    and a.cardid is null
    and a.DOWNLOADFILECREATIONFLAG = 'Y';
    update Application set CardId = vCardId,
    Card_Status = vCardStatus,APPLICATIONPROCESSEDFLAG = 'Y',
    APPLICATIONPROCESSEDdate = DOWNLOADFILECREATIONdate
    where App_Entry_No = vApp_Entry_No;
    commit;
    update DailyCardData set isprocessed = 'Y',app_entry_no = vApp_Entry_No
    where card_number = vCardId;
    commit;
    end Loop;
    close cardCur1;
    vResult := 1;
    end;
    </code>
    Can any body help me in that?
    Thank You,
    Anup

    First of all I don't see a procedure header.
    Secondly I see you commit inside your procedure. This is a bug.
    Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
    The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
    You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
    Sybrand Bakker
    Senior Oracle DBA

  • ORA-01722: invalid number when updating a CMP bean, SP10 WebLogic_RDBMS.jar problem?

    Hi guys
    We are having a problem with the migration to WLCS 3.2 SP2 / WLS 5.1 SP10.
    We are moving from WLCS 3.2 and WLS SP6. Our CMP beans generate errors when
    the container tries to update them. They deploy without error though.
    See below for the stack trace
    We use the recommended weblogic driver for our Oracle 8.1.7.0 database. WL
    runs on w2k, and Oracle on Solaris 7.
    Extract from set-environment:
    SET DB_CLASSPATH=
    SET PATH=%PATH%;%WEBLOGIC_HOME%\bin\oci815_8;%WLCS_ORACLE_HOME%\bin
    SET
    SQLPATH=C:\WebLogicCommerceServer3.2\db\oracle816;C:\WebLogicCommerceServer3
    .2\db\oracle816\event;
    Extract from weblogic.properties:
    weblogic.jdbc.connectionPool.commercePool=\
    url=jdbc:weblogic:oracle,\
    driver=weblogic.jdbc.oci.Driver,\
    I made a few experiments, and I noticed that generating the CMP classes
    (with EJBC) with the old WebLogic_RDBMS.jar (from WLS SP6) is working fine.
    Here is what I mean : ejbc uses the library
    c:\weblogic\lib\persistence\WebLogic_RDBMS.jar And this library has changed
    with SP10. However since that change and after rebuilding our jars, all CMP
    entity beans fail to update.
    If I just replace that WebLogic_RDBMS.jar with the previous one (from SP6),
    and without changing anything else, our CMP beans work fine. I did not
    change any driver or xml deployment descriptor.
    One of the generated files in the jar (for our bean
    VisibilityPSWebLogic_CMP_RDBMS.class) differs, and that seems to be the
    cause of the problem.
    I jadded that class and here is a difference I notice:
    OLD, ejbc ran with SP6 WebLogic_RDBMS.jar : visibilitybean.targetCompanyId =
    (BigDecimal)resultset.getObject(5);
    NEW, ejbc ran with SP10 WebLogic_RDBMS.jar : visibilitybean.targetCompanyId
    = resultset.getBigDecimal(5, 35);
    Similar differences for the SETbigdecimal.
    Dunno if that will help, but I'm attaching the 2 jar files with explicit
    names.
    Damn that was long, I hope someone will read it... Thanks for any help on
    this, see stack trace attached below
    Nicolas Lejeune
    Stack trace:
    mer. oct. 03 12:16:22 CEST 2001:<I> <EJB JAR deployment
    C:/WebLogicCommerceServer3.2/lib/foundation.jar> Exception in
    non-transactional EJB invoke:
    java.rmi.UnexpectedException: Unexpected exception in
    com.b2boost.visibility.VisibilityBean.getVisibilityId():
    java.sql.SQLException: ORA-01722: invalid number
    at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:230)
    at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:980)
    at
    weblogic.jdbc20.pool.PreparedStatement.executeUpdate(PreparedStatement.java:
    47)
    at
    com.b2boost.visibility.VisibilityPSWebLogic_CMP_RDBMS.update(VisibilityPSWeb
    Logic_CMP_RDBMS.java:446)
    at
    com.b2boost.visibility.VisibilityPSWebLogic_CMP_RDBMS.store(VisibilityPSWebL
    ogic_CMP_RDBMS.java:376)
    at
    weblogic.ejb.internal.EntityEJBContext.store(EntityEJBContext.java:192)
    at
    weblogic.ejb.internal.EntityEJBContext.beforeCompletion(EntityEJBContext.jav
    a:227)
    at
    weblogic.ejb.internal.StatefulEJBObject.postInvokeNoTx(StatefulEJBObject.jav
    a:355)
    at
    weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:865)
    at
    com.b2boost.visibility.VisibilityBeanEOImpl.getVisibilityId(VisibilityBeanEO
    Impl.java:198)
    at
    com.b2boost.visibility.pipeline.LoadFirstVisibilityRequestPC.process(LoadFir
    stVisibilityRequestPC.java:83)
    at
    com.beasys.commerce.foundation.pipeline.PipelineExecutorImpl.process(Pipelin
    eExecutorImpl.java:193)
    at
    com.beasys.commerce.foundation.pipeline.PipelineExecutorImplEOImpl.process(P
    ipelineExecutorImplEOImpl.java:56)
    at
    com.beasys.commerce.foundation.pipeline.PipelineExecutorImplEOImpl_ServiceSt
    ub.process(PipelineExecutorImplEOImpl_ServiceStub.java:154)
    at
    com.beasys.commerce.webflow.PipelineProcessor.callPipeline(PipelineProcessor
    .java:170)
    at
    com.beasys.commerce.webflow.PipelineProcessor.process(PipelineProcessor.java
    :102)
    at
    com.beasys.commerce.webflow.WebflowAdvisor.handleTarget(WebflowAdvisor.java:
    409)
    at
    com.beasys.commerce.webflow.WebflowAdvisor.processTarget(WebflowAdvisor.java
    :156)
    at
    com.b2boost.framework.B2boostPortalDestinationDeterminer.determineDestinatio
    n(B2boostPortalDestinationDeterminer.java:208)
    at
    com.beasys.commerce.foundation.flow.FlowManager.service(FlowManager.java:438
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :120)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:922)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:886)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:269)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
    at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    [Visibility_generated_with_SP6_weblogic_rdbms_jar.jar]
    [Visibility_generated_with_SP10_weblogic_rdbms_jar.jar]

    You are using WebLogic jDriver for Oracle which needs exact version of OCI API, that comes with the Oracle client installation. Ensure that you have installed the right Oracle client version. And updated the PATH properly.
    I notice that you have
    bin/oci815_8
    oracle816
    Thsi looks liek the inconsistency in your environment.
    What you need to do is
    1. find oci817_8 and place that in the PATH.
    2. install oracle 817 and use that client and set the ORACLE_HOME environment variable and the PATH properly.
    Try this and see if it helps.
    BTW - WLS 5.1 is EOL

  • ORA-01722: Invalid number when implementing the Ruby article sample

    Hi all,
    When I implemented the Ruby on Rails article posted in http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html, I found the following problem:
    Everything was fine until I decided to test my application. When my web app tried to access some record of the table, the following error happened:
    OCIError: ORA-01722: invalid number: select * from (select raw_sql_.*, rownum raw_rnum_ from (SELECT * FROM comics WHERE (comics.id = '2.0') ) raw_sql_ where rownum <= 1) where raw_rnum_ > 0
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:277:in `execute'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:477:in `select'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:268:in `select_all'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:390:in `find_by_sql'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:924:in `find_every'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:918:in `find_initial'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:952:in `find_one'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:941:in `find_from_ids'
    F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:382:in `find'
    #{RAILS_ROOT}/app/controllers/comics_controller.rb:16:in `show'
    The problem was related with the way RoR is accessing my table. I don't know the reason, but RoR is automatically building the SELECT sentence declaring my 'id' column as VARCHAR, so the sentence includes the expression " comics.id = '2.0' ".
    I would like to hear the advice from more experienced RoR developers in order to solve this little issue... (I believe this is more a RoR problem than an Oracle one, but I didn't find anything useful in Rail forums).
    Thank you very much in advance for your help.
    Gregorio

    Are you saying that if you do not modify the WHERE condition and run the SELECT as-is (as in your original post) in SQL*Plus, you get the same error?
    Can you post a test case? I'm not getting any error in example below.
    SQL> create table comics (id number) ;
    Table created.
    SQL> insert into comics values ('2.0') ;
    1 row created.
    SQL> insert into comics values ('2') ;
    1 row created.
    SQL> insert into comics values (2.0) ;
    1 row created.
    SQL> insert into comics values (2) ;
    1 row created.
    SQL> commit ;
    Commit complete.
    SQL> select * from comics WHERE (comics.id = '2.0') ;
            ID
             2
             2
             2
             2
    4 rows selected.
    SQL> drop table comics ;
    Table dropped.
    SQL> create table comics (id varchar2(10)) ;
    Table created.
    SQL> insert into comics values ('2.0') ;
    1 row created.
    SQL> insert into comics values ('2') ;
    1 row created.
    SQL> insert into comics values (2.0) ;
    1 row created.
    SQL> insert into comics values (2) ;
    1 row created.
    SQL> select * from comics WHERE (comics.id = '2.0') ;
    ID
    2.0
    1 row selected.
    SQL>Message was edited by:
    Kamal Kishore

  • ORA-01722: invalid number - when last column has numbers that has a decimal seperator

    Below is the sample data -
    FRT,1.64,VAT,23.36
    FRT,1.64,VAT,23.36
    When I try to convert 1.64 to to_number all is good but when I do the same with 23.36 I get the following error
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-01722: invalid number
    ORA-06512: at "SYS.ORACLE_LOADER", line 52
    I tried this query as well
    select to_number(CONSIGNMENT_NET_VALUE) as Col1 from DUMP_EXT
    select to_number(CONSIGNMENT_NET_VALUE,'9999999999D99999','NLS_NUMERIC_CHARACTERS='',.''' ) as Col1 from DUMP_EXT --> 268906.1
    getting the same error - any help greatly appreciated.
    T.
    Srini

    Hi,
    You can check this test case
    SQL> !cat a.txt
    FRT,1.64,VAT,23.36
    FRT,1.64,VAT,56.36
    FRT,1.64,VAT,23.36
    SQL> create table DUMP_EXT
        Charge_ID_FRT VARCHAR2(50),
        Net_Amount_VAT VARCHAR2(50),
        Charge_ID_VAT VARCHAR2(50),
        Consignment_Net_Value VARCHAR2(50)
    ORGANIZATION EXTERNAL
        (TYPE ORACLE_LOADER
        DEFAULT DIRECTORY DATA_DD_DIR
        ACCESS PARAMETERS
            (RECORDS DELIMITED BY '\n'
            SKIP 1
            BADFILE 'bad_%a_%p.bad'
            LOGFILE 'log.log'
            FIELDS TERMINATED BY ','
            MISSING FIELD VALUES ARE NULL
            REJECT ROWS WITH ALL NULL FIELDS
                Charge_ID_FRT CHAR(50),
                Net_Amount_VAT CHAR(50),
                Charge_ID_VAT CHAR(50),
                Consignment_Net_Value CHAR(50)
        LOCATION ('a.txt')
    reject limit 0;
      2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28 
    Table created.
    SQL> select charge_id_frt,net_amount_vat,charge_id_vat,consignment_net_value from dump_ext;
    CHARG NET_AMOUNT_VAT                                     CHARG CONSIGNMENT_NET_VALUE
    FRT   1.64                                               VAT   56.36
    FRT   1.64                                               VAT   23.36
    --- Get Error here
    SQL> select to_number(CONSIGNMENT_NET_VALUE,'99D99','NLS_NUMERIC_CHARACTERS='',.''' ) as Col1 from DUMP_EXT
      2  /
    select to_number(CONSIGNMENT_NET_VALUE,'99D99','NLS_NUMERIC_CHARACTERS='',.''' ) as Col1 from DUMP_EXT
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-01722: invalid number
    -- Check the Variable at DB level
    SQL>   SELECT value   FROM NLS_DATABASE_PARAMETERS  WHERE parameter='NLS_NUMERIC_CHARACTERS';
    VALUE
    -- Use the Query like
    SQL> select to_number(CONSIGNMENT_NET_VALUE,'99D99','NLS_NUMERIC_CHARACTERS=''.,''' ) as Col1 from DUMP_EXT;
          COL1
         56.36
         23.36
    HTH

  • "ORA-00902: invalid datatype" when trying to register local schema

    I'm trying to register a local schema which uses/includes a global schema(s). I validated the schemas using XMLSpy.
    Registering the global schema(s) was successful. Registering these global schemas was done under user "Generic". For local schemas, that use global schema, a new user is created, and the following script is executed.
    SQL> --
    SQL> -- Create user
    SQL> --
    SQL> create user &1 identified by &2
    2 temporary TABLESPACE temp
    3 default TABLESPACE users;
    old 1: create user &1 identified by &2
    new 1: create user Simple identified by Simple
    User created.
    Elapsed: 00:00:00.03
    SQL> --
    SQL> -- Grant privileges
    SQL> --
    SQL> grant create session to &1;
    old 1: grant create session to &1
    new 1: grant create session to Simple
    Grant succeeded.
    Elapsed: 00:00:00.01
    SQL> grant resource to &1;
    old 1: grant resource to &1
    new 1: grant resource to Simple
    Grant succeeded.
    Elapsed: 00:00:00.01
    SQL> -- Dunno if following is required for local schemas, but if I remove I can't FTP
    SQL> grant dba, xdbadmin to &1;
    old 1: grant dba, xdbadmin to &1
    new 1: grant dba, xdbadmin to Simple
    Grant succeeded.
    Elapsed: 00:00:00.02
    SQL>
    SQL> --
    SQL> -- Connect ;-)
    SQL> --
    SQL> connect &1/&2@SVF91;
    Connected.
    ===========================================================
    SQL> --
    SQL> -- Register the schema in Oracle
    SQL> --
    SQL> BEGIN
    2 DBMS_XMLSchema.registerSchema(
    3      schemaURL => '&1',
    4      schemaDoc => xdbURIType('&2').getClob(),
    5      local     => TRUE,
    6      genTypes => TRUE,
    7      genBean => FALSE,
    8      genTables => TRUE);
    9 END;
    10 /
    old 3: schemaURL     => '&1',
    new 3: schemaURL     => 'http://http://ehvl091a:8080/home/Simple/xsd/SimplePOI.xsd',
    old 4: schemaDoc     => xdbURIType('&2').getClob(),
    new 4: schemaDoc     => xdbURIType('/home/Simple/xsd/SimplePOI.xsd').getClob(),
    BEGIN
    ERROR at line 1:
    ORA-31084: error while creating table "SIMPLE"."SIMPLE_XPOI" for element
    "XPOIS"
    ORA-00902: invalid datatype
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
    ORA-06512: at line 2
    The schema I use is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:POI="POI" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="POI" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
         <xs:include schemaLocation="http://ehvl091a:8080/home/Generic/xsd/POI.xsd"/>
         <xs:element name="XPOIS" xdb:defaultTable="SIMPLE_XPOI">
              <xs:annotation>
                   <xs:documentation>A collection of XPOI</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Simple" minOccurs="3" maxOccurs="unbounded" xdb:columnProps="NOT SUBSTITUTABLE">
                             <xs:complexType>
                                  <xs:complexContent>
                                       <xs:extension base="POI:POIType"/>
                                  </xs:complexContent>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    I'm new at this XML (Oracle) stuff, so i could really use some pointers on how to tackle this. Thanks in advance.

    The following example works for me...
    SQL> connect / as sysdba
    Connected.
    SQL> --
    SQL> drop user global cascade
      2  /
    User dropped.
    SQL> drop user local cascade
      2  /
    User dropped.
    SQL> create user global identified by global
      2  /
    User created.
    SQL> grant connect, resource, alter session, create view, xdbadmin to global
      2  /
    Grant succeeded.
    SQL> create user local identified by local
      2  /
    User created.
    SQL> grant connect, resource, alter session, create view to local
      2  /
    Grant succeeded.
    SQL> connect global/global
    Connected.
    SQL> --
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'poTypes.xsd';
      3    :schemaPath := '/public/poTypes.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
      5  <xs:schema xmlns="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" targetNamespace="http://xmlns.oralce.com/demo/xdb/purchaseOrderT
    ypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
      6     <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T">
      7             <xs:sequence>
      8                     <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="LINEIT
    EM_V"/>
      9             </xs:sequence>
    10     </xs:complexType>
    11     <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T">
    12             <xs:sequence>
    13                     <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESCRIPTION"/>
    14                     <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
    15             </xs:sequence>
    16             <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
    17     </xs:complexType>
    18     <xs:complexType name="PartType" xdb:SQLType="PART_T">
    19             <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
    20                     <xs:simpleType>
    21                             <xs:restriction base="xs:string">
    22                                     <xs:minLength value="10"/>
    23                                     <xs:maxLength value="14"/>
    24                             </xs:restriction>
    25                     </xs:simpleType>
    26             </xs:attribute>
    27             <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
    28             <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
    29     </xs:complexType>
    30     <xs:simpleType name="ReferenceType">
    31             <xs:restriction base="xs:string">
    32                     <xs:minLength value="18"/>
    33                     <xs:maxLength value="30"/>
    34             </xs:restriction>
    35     </xs:simpleType>
    36     <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T">
    37             <xs:sequence>
    38                     <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
    39                             <xs:complexType xdb:SQLType="ACTION_T">
    40                                     <xs:sequence>
    41                                             <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
    42                                             <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
    43                                     </xs:sequence>
    44                             </xs:complexType>
    45                     </xs:element>
    46             </xs:sequence>
    47     </xs:complexType>
    48     <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T">
    49             <xs:all>
    50                     <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
    51                     <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
    52                     <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
    53             </xs:all>
    54     </xs:complexType>
    55     <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T">
    56             <xs:sequence>
    57                     <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
    58                     <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
    59                     <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
    60             </xs:sequence>
    61     </xs:complexType>
    62     <xs:simpleType name="moneyType">
    63             <xs:restriction base="xs:decimal">
    64                     <xs:fractionDigits value="2"/>
    65                     <xs:totalDigits value="12"/>
    66             </xs:restriction>
    67     </xs:simpleType>
    68     <xs:simpleType name="quantityType">
    69             <xs:restriction base="xs:decimal">
    70                     <xs:fractionDigits value="4"/>
    71                     <xs:totalDigits value="8"/>
    72             </xs:restriction>
    73     </xs:simpleType>
    74     <xs:simpleType name="UserType">
    75             <xs:restriction base="xs:string">
    76                     <xs:minLength value="1"/>
    77                     <xs:maxLength value="10"/>
    78             </xs:restriction>
    79     </xs:simpleType>
    80     <xs:simpleType name="RequestorType">
    81             <xs:restriction base="xs:string">
    82                     <xs:minLength value="0"/>
    83                     <xs:maxLength value="128"/>
    84             </xs:restriction>
    85     </xs:simpleType>
    86     <xs:simpleType name="CostCenterType">
    87             <xs:restriction base="xs:string">
    88                     <xs:minLength value="1"/>
    89                     <xs:maxLength value="4"/>
    90             </xs:restriction>
    91     </xs:simpleType>
    92     <xs:simpleType name="VendorType">
    93             <xs:restriction base="xs:string">
    94                     <xs:minLength value="0"/>
    95                     <xs:maxLength value="20"/>
    96             </xs:restriction>
    97     </xs:simpleType>
    98     <xs:simpleType name="PurchaseOrderNumberType">
    99             <xs:restriction base="xs:integer"/>
    100     </xs:simpleType>
    101     <xs:simpleType name="SpecialInstructionsType">
    102             <xs:restriction base="xs:string">
    103                     <xs:minLength value="0"/>
    104                     <xs:maxLength value="2048"/>
    105             </xs:restriction>
    106     </xs:simpleType>
    107     <xs:simpleType name="NameType">
    108             <xs:restriction base="xs:string">
    109                     <xs:minLength value="1"/>
    110                     <xs:maxLength value="20"/>
    111             </xs:restriction>
    112     </xs:simpleType>
    113     <xs:simpleType name="AddressType">
    114             <xs:restriction base="xs:string">
    115                     <xs:minLength value="1"/>
    116                     <xs:maxLength value="256"/>
    117             </xs:restriction>
    118     </xs:simpleType>
    119     <xs:simpleType name="TelephoneType">
    120             <xs:restriction base="xs:string">
    121                     <xs:minLength value="1"/>
    122                     <xs:maxLength value="24"/>
    123             </xs:restriction>
    124     </xs:simpleType>
    125     <xs:simpleType name="DateType">
    126             <xs:restriction base="xs:date"/>
    127     </xs:simpleType>
    128     <xs:simpleType name="CommentsType">
    129             <xs:restriction base="xs:string">
    130                     <xs:minLength value="1"/>
    131                     <xs:maxLength value="2048"/>
    132             </xs:restriction>
    133     </xs:simpleType>
    134     <xs:simpleType name="DescriptionType">
    135             <xs:restriction base="xs:string">
    136                     <xs:minLength value="1"/>
    137                     <xs:maxLength value="256"/>
    138             </xs:restriction>
    139     </xs:simpleType>
    140  </xs:schema>');
    141  begin
    142    if (dbms_xdb.existsResource(:schemaPath)) then
    143      dbms_xdb.deleteResource(:schemaPath);
    144    end if;
    145    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    146  end;
    147  /
    PL/SQL procedure successfully completed.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      FALSE,TRUE,FALSE,FALSE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> connect local/local
    Connected.
    SQL> --
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'po.xsd';
      3    :schemaPath := '/public/po.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<xs:schema xmlns="http://xmlns.oralce.com/demo/xdb/purchaseOrder" targetNamespace="http://xmlns.oralce.com/demo/xdb/purchaseOrder"  xm
    lns:types="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.c
    om/xdb" version="1.0" xdb:storeVarrayAsTable="true">
      5     <xs:import namespace="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" schemaLocation="poTypes.xsd"/>
      6     <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
      7     <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
      8             <xs:sequence>
      9                     <xs:element name="Reference" type="types:ReferenceType" xdb:SQLName="REFERENCE"/>
    10                     <xs:element name="Actions" type="types:ActionsType" xdb:SQLName="ACTIONS"/>
    11                     <xs:element name="Reject" type="types:RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
    12                     <xs:element name="Requestor" type="types:RequestorType" xdb:SQLName="REQUESTOR"/>
    13                     <xs:element name="User" type="types:UserType" xdb:SQLName="USERID"/>
    14                     <xs:element name="CostCenter" type="types:CostCenterType" xdb:SQLName="COST_CENTER"/>
    15                     <xs:element name="ShippingInstructions" type="types:ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
    16                     <xs:element name="SpecialInstructions" type="types:SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
    17                     <xs:element name="LineItems" type="types:LineItemsType" xdb:SQLName="LINEITEMS"/>
    18             </xs:sequence>
    19     </xs:complexType>
    20     </xs:schema>');
    21  begin
    22    if (dbms_xdb.existsResource(:schemaPath)) then
    23      dbms_xdb.deleteResource(:schemaPath);
    24    end if;
    25    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    26  end;
    27  /
    PL/SQL procedure successfully completed.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> desc PURCHASEORDER
    Name                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "po.xsd" Element "PurchaseOrder") STORAGE Object-relational TYPE "PURCHASEORDER_T"
    SQL> desc PURCHASEORDER_T
    PURCHASEORDER_T is NOT FINAL
    Name                                      Null?    Type
    SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
    REFERENCE                                          VARCHAR2(30 CHAR)
    ACTIONS                                            GLOBAL.ACTIONS_T
    REJECTION                                          GLOBAL.REJECTION_T
    REQUESTOR                                          VARCHAR2(128 CHAR)
    USERID                                             VARCHAR2(10 CHAR)
    COST_CENTER                                        VARCHAR2(4 CHAR)
    SHIPPING_INSTRUCTIONS                              GLOBAL.SHIPPING_INSTRUCTIONS
                                                        _T
    SPECIAL_INSTRUCTIONS                               VARCHAR2(2048 CHAR)
    LINEITEMS                                          GLOBAL.LINEITEMS_T
    SQL>I'm not sure what you were trying here in your xml schema
    xdb:columnProps="NOT SUBSTITUTABLE">
    or whether or not this annotation is the source of the problem

  • Error Message (ORA-01722: invalid number) when add amount into Number field

    I am using VB.net, trying to insert data into a field called amt with Data Type 'Number'.
    my vb.net code is as follows
    Dim oradb As String = DatabaseConnectionString
    Dim AmountValue As Decimal = 123.45
    'get the connection
    Dim conn As New OracleConnection(oradb)
    'open the database connection
    conn.Open()
    'create oracle command
    Dim cmd As New OracleCommand("INSERT INTO TBL1 (AMT) VALUES (:AMT)", conn)
    cmd.CommandType = CommandType.Text
    cmd.Parameters.Add(":AMT", OracleDbType.Decimal, AmountValue, ParameterDirection.Input)
    'Execute
    cmd.ExecuteNonQuery()
    I got error message "ORA-01722: invalid number". Please help

    Did you also change the below line before inserting Integer 123:
    cmd.Parameters.Add(":AMT", OracleDbType.Decimal, AmountValue, ParameterDirection.Input)
    to
    cmd.Parameters.Add(":AMT", OracleDbType.Integer, AmountValue, ParameterDirection.Input)

  • ORA-01722: Invalid number when importing .csv file

    Hi,
    I did not find any information regarding my specific problem until now.
    I try to import a *.csv file containing id, double, double, double, double, double (e.g. as a sample line "id_1, 674,6703459157907, 4212,205538937771, 674,6703459158016, 5561,546230769363, 2714,6367797576822") into a table with the following definition:
    CREATE TABLE "foo"."BUILDING_SURFACES"
    (     "ID" VARCHAR2(40 BYTE),
         "AREA1" BINARY_DOUBLE DEFAULT 0,
         "AREA2" BINARY_DOUBLE DEFAULT 0,
         "AREA3" BINARY_DOUBLE DEFAULT 0,
         "AREA4" BINARY_DOUBLE DEFAULT 0,
         "AREA5" BINARY_DOUBLE DEFAULT 0
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ;
    I am doing it with the help of the importer tool in the SQLDeveloper, by doing a right-click onto the table and selecting import data. In the assistant everything seem to be fine, even the data preview.
    But when I try to import, I get an error: "ORA-01722: Invalid number" and a couple of failure windows appear. These windows display a NullPointerException:
    java.lang.NullPointerException
         at oracle.dbtools.raptor.data.writers.DataTypeFormatterRegistry.getFormattor(DataTypeFormatterRegistry.java:42)
         at oracle.dbtools.raptor.data.writers.ImportGenerator.getBatchForInsert(ImportGenerator.java:1837)
         at oracle.dbtools.raptor.data.writers.ImportGenerator.access$1800(ImportGenerator.java:84)
         at oracle.dbtools.raptor.data.writers.ImportGenerator$1.afterLoopProcessing(ImportGenerator.java:1125)
         at oracle.dbtools.raptor.newscriptrunner.ScriptExecutorTask.loopThroughAllStatements(ScriptExecutorTask.java:220)
         at oracle.dbtools.raptor.newscriptrunner.ScriptExecutorTask.doWork(ScriptExecutorTask.java:165)
         at oracle.dbtools.raptor.data.writers.ImportGenerator$1.doWork(ImportGenerator.java:782)
    If I cancel the task, the insert statements are displayed:
    SET DEFINE OFF
    --Einfügen für Zeilen  1  bis  2  nicht erfolgreich
    --ORA-01722: Ungültige Zahl
    --Zeile 1
    INSERT INTO BUILDING_SURFACES (ID, AREA1, AREA2, AREA3, AREA4, AREA5) VALUES ('BLDG_0003000b002ea10f','674.6703459157907','4212.205538937771','674.6703459158016','5561.546230769363','2714.6367797576822');
    --Zeile 2
    As one can see, the numbers are quoted ('). If I delete the quotes by hand, the insert statement works correctly.
    What can I do, so that the import tool does not quote the numbers?
    Deleting the quotes with the help of a regular expression is not workaround, since a lot of error windows appear, which needs to be closed by hand...
    Thanks in advance,
    Richard
    Some infos about my machine:
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 12.10
    Release: 12.10
    Codename: quantal
    $ java -version
    java version "1.6.0_38"
    Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)
    Oracle SQL Developer 3.2.20.09
    Version 3.2.20.09
    Build MAIN-09.87
    Copyright © 2005, 2012 Oracle. All Rights Reserved. Alle Rechte vorbehalten.
    IDE Version: 11.1.1.4.37.59.48
    Product ID: oracle.sqldeveloper
    Product Version: 11.2.0.09.87

    I solved my problem. :)
    I changed the datatype of the area fields to "NUMBER" and edited my input file in a way, that it is tab separated with "," as decimal sign.
    Richard

  • ORA-01722: invalid number when performing query

    Hi,
    I am running SQL Developer on a laptop (XP Pro) accessing Oracle Applications
    Product Version     11.5.10.2
    Platform     IBM SP AIX
    OS Version     AIX
    Database     9.2.0.7.0
    Support ID     14460365
    If I run the following query it works fine -
    select
    mtrh.request_number
    ,to_number(mtrh.request_number)
    from
    mtl_txn_request_headers mtrh
    where
    to_number(mtrh.request_number) = 135060
    and mtrh.request_number = '135060' -- works with this line in!!!!
    however if I comment out the last line I get
    An error was encountered performing the requested operation :
    ORA-01722: invalid number
    The field request_number is defined as varchar2(30)
    It seems that there is something strange about the way it handles to_number in where clauses.
    Thanks
    Mick Sulley

    You have an invalid number in request_number. If you add "and mtrh.request_number = '135060' ", the result set will be reduced to only those rows which have 135060 in the column and the to_number() will work. WIthout that row, it does to_number(request_number) for all rows in order to identify the one you want. When it comes across a request_number column which contains an invalid number it reports an error.
    <preach>
    If request_number is a number then it should be stored in a number column. If it isn't, don't try an convert it to a number.
    </preach>

Maybe you are looking for