Invalid number in insert

Hi people,

I am looking for a way to find which of the 100 columns in an insert causes the error invalid number. Problem is deeply nested inside several procedures, so it is difficult to pull out of the insert and then remove line-by-line until I get to the problem. Y at - it a quick way oracle would say XYZ column causes the error invalid number?


Best regards
Igor

DML Error Logging - I guess , is what you need exactly.

Please refer - DML Error Logging

-Http://www.orafaq.com/node/76
>
Logging of DML errors is a new feature for 10 gr 2. Have you tried updating the 30 million records, only to have the update fail after twenty minutes, because a single record in 30 million does not reach a check constraint? Or, what would you say a insert-as-select which fails to 999 1000 rank as a column value is too large? With DML error logging , adding a clause to your insert statement would lead the 999 correct to be inserted successfully records and the a wrong record to be written in a table for you to solve.
>

HTH
Vanessa B.

Published by: Vanessa B on January 15, 2013 14:26

Tags: Database

Similar Questions

  • Select list LOV (error ORA-01722: invalid number)

    Hello
    I use this procedure to insert data into a table through a submit after processes.
    CREATE OR REPLACE
    PROCEDURE PR_INS_TMP_STUDENTS(
    v_tmp_stu_id_in     IN      NUMBER
    )
    IS
    BEGIN
    
    
      INSERT INTO TMP_STUDENTS (
          stu_id,
          stu_name_last,
             stu_name_first,
             stu_name_middle,
             stu_name_suffix,
             stu_name_prefer_last,
          stu_name_prefer_first,
          sch_id
          )
      VALUES (
          v_tmp_stu_id_out,
          V('p50100_stu_name_last'),
          V('p50100_stu_name_first'),
          V('p50100_stu_name_middle'),
          V('p50100_stu_name_suffix'),
          V('p50100_stu_name_prefer_last'),
          V('p50100_stu_name_prefer_first'),
          V('p50100_sch_id')
          );
    
    END;
    I kept getting this error during the presentation of the page.
    ORA-01722: invalid number
    Error      Insert Failed! 
    I go back to sch_id which is a list of number type selection (3.0). The LOV selection list has the following attributes:
    Display extra value: No
    Dynamic Translation: No
    Number of Columns: 1
    Display Null: Yes
    Null Display Value: blank
    Null Return Value: blank
    Here's the code for the LOV:
    SELECT distinct(site_id || ' - ' || initcap(lower(site_name))) site_desc, site_id ret_val
    FROM sa.SITE_DEMOGRAPHICS@sis
    order by 2
    I don't know why I kept ORA-01722: invalid number during the presentation of the page. Everyone ran through this issue?

    Hello

    First of all, you should also use nv ('itemname') for numeric values-, make sure you use v() instead of V() for others.

    If the p50100_sch_id can be null, the return value will be "null %" - which could be the cause of the error.

    In such cases, I tend to do something like -1 of the value zero, then do a test for that, in the code - if the value is - 1, I replace NULL

    Andy

  • Error invalid number

    Dear Experts

    In fact, we have two packages one is master and another package which is subpart of the master package...

    Now the question is when I run only subpart, it works well. If run master and then to Subpart package and then the package is a failure...

    When I checked the error code is not a valid number. When I checked the code the error occurs during insertion...

    in my sql developer, I tried this insertion and I don't have any error invalid number.

    When I run simply Subpart together then I don't have this error number it runs successfully...

    When I run the master package calling this subpart, then I get an error invalid number.

    can you please how to debug or explore the problem...

    Best regards

    ASP.

    If you need a solution to get out variables for 11.1.1.5 to take a look at the procedure, generic, as demonstrated at the following link

    Variables to run wrong for older versions of the ODI | EMP DEV

    put this procedure in a package and run just before that your interface is running but after all variables have been defined and it will list the values of the variables in the operator and if all goes well to highlight the rogue variable

  • Regular expression for invalid number

    Hello world

    I use version oracle as follows:

    SQL > select * from v version $;

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    AMT for 32-bit Windows: release 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

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

    I use a regular expression to replace invalid values in a table.

    I got oracle error 'ORA-01722 invalid number '.

    My query looks like this:

    SELECT DISTINCT

    MRC_KEY,

    PURPOSE_CD,

    RESIDENCE_DESC,

    TO_NUMBER (regexp_replace (ICAP_GEN_MADAPTIVE, "..?")) 0? 0? (\d+) [-.] ((?', '\1')) as ICAP_GEN_MADAPTIVE,

    Of

    MRRC_INT

    I don't know what are invalid values in the table, so I can write regexp accordingly.

    Any guidance is appreciated!

    Thanks in advance

    J

    Hello

    Whenever you have a problem, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.  View of the code which is not what you want can be useful, but there niot enough by itself.
    See the FAQ forum: https://forums.oracle.com/message/9362002

    Let's look at what you do:

    REGEXP_REPLACE (icap_gen_madaptive

    , '[+. ]' || -exactly 1 of these characters

    '?0?0?' || -up to 2 ' 0 '

    '(\d+)' || -some numbers (it comes to \1)

    '[-.]?'    -0 or 1 of these characters

    , '\1'

    )

    Is it really what you want?  A group of figures don't match, as the patten must start with a sign more, a point or a space.  You want to allow a decimal point at the beginning and at the end, as in "." 9. '?  If there are numbers before and after the decimal point, as in "1.2", you want only the digints before the comma?  You never said what you want, but I'm guessing that these are things that you don't want.

    If the pattern is found, this changes only the schema, so a string like "FU + 123 BAR" more than the model + 9 "" changed to "9" and the resulting string. "" "" FU9BAR"would be passed TO_NUMBER.

    If the pattern is not found, as in "FOO", nothing is changed, and the entire string is passed to TO_NUMBER.

    I suspect you want to use instead of REGEXP_REPLACE REGEXP_SUBSTR, or, if there is stuff to ignore before and/or after the number you want to include in the model, so that REGEXP_REPLACE will be replaced by nothing.

    This looks like a good argument to use the NUMBER of columns to store numbers.

  • Error: ORA-01722: invalid number

    Hello

    Can some please tell me what I'm doing wrong when I try to make a difference?

    Since the format is the same I use this query

    Select b1 - b2 of TMP_1;
    Error: ORA-01722: invalid number
    --create table         
        CREATE TABLE TMP_1
    (
      B1  VARCHAR2(8 BYTE),
      B2  VARCHAR2(8 BYTE)
    ) 
    /
    
    --insert 
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:02:54', '00:02:10');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:05:47', '00:03:56');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:12:49', '00:02:37');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:49:33', '00:02:09');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:06:34', '00:02:39');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:02:45', '00:01:41');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:01:22', '00:00:22');
    
    COMMIT;
    objective:

    Need to get the difference in the same format as the
     columns example: 00:02:54 

    Please provide examples of data, it is very useful. Here's one way:

    SQL> select b1, b2,
      2         b1 - (to_date(to_char(sysdate, 'dd-mon-yyyy')||' '||b2,'dd-mon-yyyy hh24:mi:ss') - trunc(sysdate)) b3
      3  from tmp_1;
    
    B1                   B2       B3
    -------------------- -------- --------------------
    03-dec-2012 20:13:33 00:02:10 03-dec-2012 20:11:23
    03-dec-2012 18:24:24 00:03:56 03-dec-2012 18:20:28
    03-dec-2012 21:48:33 00:02:37 03-dec-2012 21:45:56
    03-dec-2012 15:50:09 00:02:09 03-dec-2012 15:48:00
    03-dec-2012 14:06:24 00:02:39 03-dec-2012 14:03:45
    03-dec-2012 21:47:15 00:01:41 03-dec-2012 21:45:34
    

    John

  • SQL * Loader - rejected records - error on table ORA-01722: invalid number

    Get the following errors:

    Please tell me where I'm wrong?
    The log file and extracts the data file with the control file is attached.
    Also guide me please how I can download 4900 files at once?

    -------------------------------------
    SQL * Loader: release 11.1.0.7.0 - Production on Fri 14 Oct 03:06:06 2011

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Control file: sample.ctl
    Data file: Cities.csv
    Bad leadership: Cities.bad
    Discard File: none is specified

    (Allow all releases)

    Number of loading: ALL
    Number of jump: 0
    Authorized errors: 50
    Link table: 64 lines, maximum of 256000 bytes
    Continuation of the debate: none is specified
    Path used: classics

    Table CITY, loaded from every logical record.
    Insert the option in effect for this table: INSERT

    Column Position Len term Encl. Datatype name
    ------------------------------ ---------- ----- ---- ---- ---------------------
    FIRST ID *, CHARACTER
    35. ACCORDING TO NAME, ' CHARACTER
    COUNTRYCODE 3, ' CHARACTER
    THE NEXT POPULATION * CHARACTER WHT

    Sheet 1: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 2: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 3: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Folder 4: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 5: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 6: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 7: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 8: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 9: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Case 10: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Factsheet 11: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 12: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 13: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 14: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 15: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 16: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 17: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 18: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 19: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 20: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 21: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Account 22: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 23: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record number of 24: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 25: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 26: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 27: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 28: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 29: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 30: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record of 31: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    • Statement 32: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 33: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 34: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 35: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 36: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 37: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 38: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 39: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 40: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 41: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 42: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 43: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 44: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 45: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    • Statement 46: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 47: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 48: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 49: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 50: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 51: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number


    NUMBER of MAXIMUM ERRORS EXCEEDED - above the statistics reflect partial performance.

    CITY table:
    0 rows successfully loaded.
    51 lines not filled due to data errors.
    0 rows not loading because all WHEN clauses were failed.
    0 rows not populated because all fields are null.


    The space allocated to bind table: 35840 bytes (64 lines)
    Bytes of read buffer: 1048576

    Total logical records ignored: 0
    Total logical records read: 64
    Total rejected logical records: 51
    Total logical records ignored: 0

    Run started on Fri 14 Oct 03:06:06 2011
    Run finished Fri Oct 14 03:06:12 2011

    Time was: 00:00:06.18
    Time processor was: 00:00:00.03



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

    my control file (sample.ctl):

    Load data infile 'Cities.csv '.
    in the town of table
    fields completed by «,»
    (external id integer,
    char (35) name box by ' ', '
    CountryCode tank (3) box by ' ', '
    external population integer terminated by '\n '.
    )

    my data (Cities.csv) file (it contains 4900 documents, but I show here just 4 records for ease)

    3830, "Virginia Beach", "USA", 425257
    3831, 'Atlanta', 'USA', 416474
    3832, "Sacramento", "USA", 407018
    3833, 'Oakland', 'USA', 399484


    Thanks in advance!

    Watch when I have a little change your database as follows

    1,'Kabul','AFG',1780000
    2,'Qandahar','AFG','237500'
    3,'Herat','AFG','186800'  
    

    I got the same error (last 2 rows rejected for the same number invalid error)

    mhouri > select * from cities;
    
            ID NAME                                COU POPULATION
    ---------- ----------------------------------- --- ----------
             1 Kabul                               AFG    1780000
    
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Oct 14 10:38:06 2011
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Control File:   cities.ctl
    Data File:      cities.dat
      Bad File:     cities.bad
      Discard File:  none specified
    
     (Allow all discards)
    
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    
    Table CITIES, loaded from every logical record.
    Insert option in effect for this table: INSERT
    
       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    ID                                  FIRST     *   ,       CHARACTER
    NAME                                 NEXT    35   ,    '  CHARACTER
    COUNTRYCODE                          NEXT     3   ,    '  CHARACTER
    POPULATION                           NEXT     *  WHT      CHARACTER            
    
    Record 4: Rejected - Error on table CITIES, column ID.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table CITIES, column POPULATION.
    ORA-01722: invalid number
    
    Record 3: Rejected - Error on table CITIES, column POPULATION.
    ORA-01722: invalid number
    
    Table CITIES:
      1 Row successfully loaded.
      3 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    
    Space allocated for bind array:                  35840 bytes(64 rows)
    Read   buffer bytes: 1048576
    
    Total logical records skipped:          0
    Total logical records read:             4
    Total logical records rejected:         3
    Total logical records discarded:        0
    
    Run began on Fri Oct 14 10:38:06 2011
    Run ended on Fri Oct 14 10:38:06 2011
    
    Elapsed time was:     00:00:00.23
    CPU time was:         00:00:00.09
    

    Value of the population within the data file must be a number

    Best regards

    Mohamed Houri

  • SQL * Loader invalid number error

    I'm trying to load a .csv using SQL * Loader and all ranks is rejected with an error invalid number.

    Here is the control file:

    OPTIONS (SKIP = 1)
    DOWNLOAD THE DATA
    INFILE 'shi_claims.csv '.
    REPLACE IN THE TABLE SHI_CLAIMS
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    TRAILING NULLCOLS
    (
    ID TANK
    DECIMAL EXTERNAL AMT
    )

    Here are the first lines of data in the .csv (note I am ignoring the first line):

    EmployeeID, PaidAmnt
    100550393,0
    100709611,120.04
    100795648,90
    100795648,5.24

    Here is the structure of the table, I'm trying to load:

    CREATE THE TABLE UST_GLOBAL. SHI_CLAIMS
    (
    ID VARCHAR2 (9 CHAR),
    AMT NUMBER (8.2)
    )

    Here's the .log file that results. All ranks lands in the .bad file.

    SQL * Loader: Release 10.2.0.4.0 - Production on Mon Mar 7 16:34:09 2011

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Control file: /u02/sct/ust/shi_claims.ctl
    Data file:././data.7609732
    Bad leadership: 7609732.bad
    Delete the file: discard.7609732
    (Allow all releases)

    Number of loading: ALL
    Number of jump: 1
    Authorized errors: 50
    Link table: 64 lines, maximum of 256000 bytes
    Continuation of the debate: none is specified
    Path used: classics

    Table SHI_CLAIMS, loaded from every logical record.
    Insert the option in effect for this table: REPLACE TRAILING NULLCOLS option in effect

    Column Position Len term Encl. Datatype name
    ------------------------------ ---------- ----- ---- ---- ---------------------
    FIRST ID *, O ("") CHARACTER
    AMT NEXT *, O ("") CHARACTER

    Sheet 1: Rejected - error on the SHI_CLAIMS, AMT column table.
    ORA-01722: invalid number

    Sheet 2: Rejected - error on the SHI_CLAIMS, AMT column table.
    ORA-01722: invalid number

    (.. .and so forth for all ranks).

    I note that in the copy of the control file that is displayed in the .log file, the column AMT appears as a CHARACTER, while my control file means DECIMAL EXTERNAL. Could why, and this be part of the problem?

    Thanks for any help...

    Published by: wrfoster on March 8, 2011 09:40

    wrfoster wrote:
    Ideas on how to get rid of them?

    Well, ideally, if you can get rid of them when creating csv... If not do the AMT DUMP as I suggested previously to get the exact or the end characters ascii codes. Assuming that it is the new line of Chr (10) put the following text in the loader control file:

    AMT "RTRIM (:AMT,CHR(10)).

    SY.

  • We get a "invalid number" error when the Xref database of fill

    Hi all

    My table (XREF_DATA) target has the following parameters and its respective data types: -.

    XREF_TABLE_NAME
    XREF_COLUMN_NAME
    ROW_NUMBER
    VALUE
    IS_DELETED
    LAST_MODIFIED
    LAST_ACCESSED

    All are varchar2

    But when I am executing the interface and observing the results then this error pops up:-1722: 42000: java.sql.SQLException: ORA-01722: invalid number to the stadium
    Insert flow I$ Table(I$_XREF_DATA)

    I used CKM, LKMSql for Oracle and the incremental update of the IKM Oracle)


    My target table has all the varchar2 data type, then why it gives this error number invalid?



    Kind regards
    Sourav

    Hello

    You can copy the SQL code generated by ODI (for the stage which gives this error) and then try to run it through any SQL client like toad / developer sql etc.
    This will help you find erroneous data.

    Also is LAST_MODIFIED and LAST_ACCESSED have as VARCHAR2 data type? The name it seems that it is lying do DATE.

    Thank you
    Fati

  • Invalid number when reading a flat file

    Hello Experts,

    I have the following flat file format and I want to insert it into a table
    I have an error invalid number.

    How can I stop reading the file when it reaches the empty line before the grand total

    file
    ----------------------------------------------------------------------------------------------------------------------------------
    
                       TOTAL        PAID       TOTAL     EXPIRED       TOTAL    FRAC OUTSTANDING
                     WINNERS       TODAY        PAID       TODAY     EXPIRED   ROUND
        DRAW/SET      AMOUNT      AMOUNT      AMOUNT      AMOUNT      AMOUNT  AMOUNT      AMOUNT
    ------------ ----------- ----------- ----------- ----------- ----------- ------- -----------
        1/     1  6857068.00        0.00  5879902.00        0.00   977166.00    0.00        0.00
        2/     1  5907322.00        0.00  5463759.00        0.00   443563.00    0.00        0.00
        3/     1  7277181.00        0.00  6551708.00        0.00   725473.00    0.00        0.00
        4/     1 37503734.00        0.00 36656046.00        0.00   847688.00    0.00        0.00
        5/     1  4879934.00        0.00  4293514.00        0.00   586420.00    0.00        0.00
        6/     1 15604133.00        0.00 15172198.00        0.00   431935.00    0.00        0.00
        7/     1  4943514.00        0.00  4425254.00        0.00   518260.00    0.00        0.00
        8/     1  6493874.00        0.00  5745660.00        0.00   748214.00    0.00        0.00
        9/     1 23195487.00        0.00 22279945.00        0.00        0.00    0.00   915542.00
        10/    1  5480445.00        0.00  4981615.00        0.00        0.00    0.00   498830.00
        11/    1  5421101.00        0.00  4852814.00        0.00        0.00    0.00   568287.00
        12/    1 22644465.00        0.00 21987329.00        0.00        0.00    0.00   657136.00
        13/    1  6310425.00        0.00  5582127.00        0.00        0.00    0.00   728298.00
        14/    1  5986847.00        0.00  5471429.00        0.00        0.00    0.00   515418.00
        15/    1  6699299.00        0.00  6080687.00        0.00        0.00    0.00   618612.00
        16/    1  7549513.00        0.00  6842058.00        0.00        0.00    0.00   707455.00
        17/    1 43951014.00        0.00 42538841.00        0.00        0.00    0.00  1412173.00
        18/    1  6275029.00        0.00  5608261.00        0.00        0.00    0.00   666768.00
        19/    1 34023432.00      100.00 33066516.00        0.00        0.00    0.00   956916.00
        20/    1  5496324.00        0.00  5029237.00        0.00        0.00    0.00   467087.00
        21/    1  5791146.00        0.00  5281256.00        0.00        0.00    0.00   509890.00
        22/    1  7121128.00        0.00  6419500.00        0.00        0.00    0.00   701628.00
        23/    1 36121507.00        0.00 35211831.00        0.00        0.00    0.00   909676.00
        24/    1 10137379.00        0.00  9660197.00        0.00        0.00    0.00   477182.00
        25/    1  4267656.00      200.00  3875040.00        0.00        0.00    0.00   392616.00
        26/    1  8656241.00      561.00  7744762.00        0.00        0.00    0.00   911479.00
        27/    1 10023865.00      400.00  9070015.00        0.00        0.00    0.00   953850.00
        28/    1 15201340.00     1188.00 13795352.00        0.00        0.00    0.00  1405988.00
        29/    1 83052341.00     2773.00 80673373.00        0.00        0.00    0.00  2378968.00
        30/    1  7137232.00     1000.00  6459875.00        0.00        0.00    0.00   677357.00
        31/    1 25472826.00     1700.00 24487312.00        0.00        0.00    0.00   985514.00
        32/    1  5679593.00     4398.00  5094378.00        0.00        0.00    0.00   585215.00
        33/    1 19360140.00    32659.00 18144162.00        0.00        0.00    0.00  1215978.00
        34/    1  5350117.00  1059167.00  1059167.00        0.00        0.00    0.00  4290950.00
    
    GRAND TOTAL  ########.##  1104146.00 ########.##        0.00  5278719.00    0.00 25108813.00
    
    End of Report
    code
    declare
    l_start_file_name varchar2(50) := 'liab_report_summary_p008_c';
    l_end_file_name varchar2(50)   := '_english.rep';
    l_file_name varchar2(100);
    l_sql varchar(32767);
    refresh_cdc varchar2(10) := '00540';
    
    Begin
    
    l_file_name := l_start_file_name||REFRESH_CDC||l_end_file_name;
    
     l_sql := 'create or replace directory GTECHFILES as ''/ftpfiles/gtechfiles/acct_'||REFRESH_CDC||'''';
      execute immediate l_sql;
    
    
    l_sql :=  ' CREATE TABLE LOTO_LIABILITY_REPORT_temp             '||
              ' (                                                   '||
              '  draw_number       varchar2(50),                    '||
              '  total_winners_amt number,                          '||
              '  paid_today_amt    number,                          '||
              '  total_paid_amt    number,                          '||
              '  expired_today_amt number,                          '||
              '  total_expired_amt number,                          '||
              '  frac_round_amt    number,                          '||
              '  outstanding_amt   number                           '||
              ' )                                                   '||
              ' ORGANIZATION EXTERNAL                               '||
              '   (  TYPE ORACLE_LOADER                             '||
              '     DEFAULT DIRECTORY GTECHFILES                    '||
              '     ACCESS PARAMETERS                               '||
              '       ( records delimited by newline                '||
              '      LOGFILE TEMPDIR:''loto_liability_report.log''  '||
              '      SKIP 8                                         '||            
              '      FIELDS LDRTRIM                                 '||
              '      MISSING FIELD VALUES ARE NULL                  '||
              '       (                                             '||
              '  draw_number       (1:11)  char(11),                '||
              '  total_winners_amt (14:24) char(11),                '||
              '  paid_today_amt    (26:36) char(11),                  '||
              '  total_paid_amt    (38:48) char(11),                  '||
              '  expired_today_amt (50:60) char(11),                  '||
              '  total_expired_amt (62:72) char(11),                  '||
              '  frac_round_amt    (74:80) char(11),                  '||
              '  outstanding_amt   (82:92) char(11)                   '||
              '       )                                             '||
              '   )                                                 '||
              '     LOCATION ('''||l_file_name||''')                '||
              ' )                                                   '||
              ' REJECT LIMIT UNLIMITED                              '||
              ' NOPARALLEL                                          '||
              ' NOMONITORING                                        ';
    
             execute immediate l_sql; 
     
     l_sql := ' insert into LOTO_LIABILITY_REPORT '||
     ' ( draw_number             , '||
     '   total_winners_amt       , '||
     '   paid_today_amt          , '||
     '   total_paid_amt          , '||
     '   expired_today_amt       , '||
     '   total_expired_amt       , '||
     '   frac_round_amt          , '||
     '   outstanding_amt         , '||
     '   source                  , '||
     '   inserted_DATE           , '||
    -- '   UPLOADED                 ,'||
     '   CDC                       '||
     ' )                           '||
     '   SELECT                    '||
     '       draw_number    , '||
     '       TO_NUMBER(total_winners_amt,''999,999,999.00'') total_winners_amt,  '||
     '       TO_NUMBER(paid_today_amt,''999,999,999.00'') paid_today_amt,        '||
     '       TO_NUMBER(total_paid_amt,''999,999,999.00'') total_paid_amt,        '||
     '       TO_NUMBER(expired_today_amt,''999,999,999.00'') expired_today_amt,        '||
     '       TO_NUMBER(total_expired_amt,''999,999,999.00'') total_expired_amt,        '||
     '       TO_NUMBER(frac_round_amt,''999,999,999.00'') frac_round_amt,        '|| 
     '       TO_NUMBER(outstanding_amt,''999,999,999.00'') outstanding_amt,        '||  
     '       '''||l_file_name                                       ||''', '||
     '       sysdate                                                     , '||
     --'     ''N''                                                         , '||
             refresh_cdc                                                    ||
     '    FROM                                                             '||
     '       LOTO_LIABILITY_REPORT_temp                                              ';
    
     
        dbms_output.put_line(l_sql);
             execute immediate l_sql;           
             
    ll_sql :='drop table LOTO_LIABILITY_REPORT_temp';
     
            execute immediate l_sql;
    
    exception
    when others then
    rollback;
    l_sql :='drop table LOTO_LIABILITY_REPORT_temp';
    execute immediate l_sql;
    debug_message('LOTO_LIABILITY_REPORT_temp_UPLOAD/'||REFRESH_CDC,'Unexpected Error '||sqlerrm);
    END LOTO_LIABILITY_REPORT;
    any help would be greatly appreciated.

    Thank you
    Kevin

    Hello

    You can do this:
    Add this condition in the table definition
    WHEN LOAD (total_winners_amt! = "#.") "#" and total_paid_amt! =" ###. "#" and draw_number! = BLANKS)
    and do it for each column that can have this value...

    CREATE TABLE WEBUSER.LOTO_LIABILITY_REPORT_TEMP
    (
      DRAW_NUMBER        VARCHAR2(50 BYTE),
      TOTAL_WINNERS_AMT  NUMBER,
      PAID_TODAY_AMT     NUMBER,
      TOTAL_PAID_AMT     NUMBER,
      EXPIRED_TODAY_AMT  NUMBER,
      TOTAL_EXPIRED_AMT  NUMBER,
      FRAC_ROUND_AMT     NUMBER,
      OUTSTANDING_AMT    NUMBER
    )
    ORGANIZATION EXTERNAL
      (  TYPE ORACLE_LOADER
         DEFAULT DIRECTORY GTECHFILES
         ACCESS PARAMETERS
           ( records delimited by newline
                    LOGFILE GTECHFILES:'loto_liability_report.log'
                    SKIP 8
                    LOAD WHEN (total_winners_amt!="########.##" and total_paid_amt!="########.##" and draw_number != BLANKS)
                    FIELDS LDRTRIM
                    MISSING FIELD VALUES ARE NULL
                     (
                draw_number       (1:11)  char(11),
                total_winners_amt (14:24) char(11),
                paid_today_amt    (26:36) char(11),
                total_paid_amt    (38:48) char(11),
                expired_today_amt (50:60) char(11),
                total_expired_amt (62:72) char(11),
                frac_round_amt    (74:80) char(7),
                outstanding_amt   (82:92) char(11)
                     ) 
    
                  )
         LOCATION (GTECHFILES:'test.txt')
      )
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;
    

    You'll get in the log file:

     LOG file opened at 06/28/10 22:16:51
    
    Field Definitions for table LOTO_LIABILITY_REPORT_TEMP
      Record format DELIMITED BY NEWLINE
      Data in file has same endianness as the platform
      Rows with all null fields are accepted
      Load when ((TOTAL_WINNERS_AMT != ########.##) AND ((TOTAL_PAID_AMT != ########.##) AND (DRAW_NUMBER != BLANKS)))
    
      Fields in Data Source: 
    
        DRAW_NUMBER                     CHAR (11)
          Record position (1, 11)
          Trim whitespace same as SQL Loader
        TOTAL_WINNERS_AMT               CHAR (11)
          Record position (14, 24)
          Trim whitespace same as SQL Loader
        PAID_TODAY_AMT                  CHAR (11)
          Record position (26, 36)
          Trim whitespace same as SQL Loader
        TOTAL_PAID_AMT                  CHAR (11)
          Record position (38, 48)
          Trim whitespace same as SQL Loader
        EXPIRED_TODAY_AMT               CHAR (11)
          Record position (50, 60)
          Trim whitespace same as SQL Loader
        TOTAL_EXPIRED_AMT               CHAR (11)
          Record position (62, 72)
          Trim whitespace same as SQL Loader
        FRAC_ROUND_AMT                  CHAR (7)
          Record position (74, 80)
          Trim whitespace same as SQL Loader
        OUTSTANDING_AMT                 CHAR (11)
          Record position (82, 92)
          Trim whitespace same as SQL Loader
    KUP-04102: record 41 discarded from file c:\temp\test.txt
    KUP-04102: record 42 discarded from file c:\temp\test.txt
    KUP-04102: record 43 discarded from file c:\temp\test.txt
    KUP-04102: record 44 discarded from file c:\temp\test.txt
    

    ORA-01722 exception has disappeared...
    be very vigilant, you also should jump 6 instead of spend 8...

  • ORA-01722: invalid number error

    Hello Experts,

    I'm having a problem downloading a text file.

    It works ok for some files but for some files I get the following error

    ORA-01722: invalid number

    Anyone know what could be the reason of this please. Just tell me what you need more details.

    Thank you
    Kevin

    Hello
    OK now the image grows.
    So, you dynamically create the insert statement, replace the comma with nothing and then insert.
    The system from which you found the data file is this number of column type sales NET in this system or even stores characters.
    Assuming that the data type is a generic system remote here is the scenarios where it will fail

    select to_number(replace('23 ,380.00 ',',','') )  from dual -- not ok observe before comma
    select to_number(replace('a23,380.00 ',',','') )  from dual -- not ok
    select to_number(replace('23,380. 00 ',',','') )  from dual -- not ok observe space after decinal
    

    My Suggestion,
    take the file upload in a temporary table using sqlldr.
    Next moment, you have the incorrect records.
    Keep an eye on them.
    In addition, the use of external tables is an option where you can log records failed.

    Kind regards
    Bobin

  • How can I get a name of table 1, column A, if column B is a negative number and insert the names of table 2?

    How can I get a name of table 1, column A, if column B is a negative number and insert the names of table 2?

    What is the formula?

    You can do this with a column of "index" in table 1, as this assistance:

    The formula in C2, filled to the bottom:

    IF (B =<>

    That increments a counter each time that it finds a negative number in column B.

    In the second table, you can retrieve a list of negative values in this way:

    The formula in A2, filled to the bottom:

    = INDEX (array 1::A, CORRESPONDENCE (LINE (−1, Table 1::C), 0))

    It takes the line number, the formula is activated, subtracts 1 to the header line and look up the result in the column of table 1 C.  If it finds a match, it feeds the line number to the INDEX page with retrieves the value of the column of table 1A.

    To hide the red triangles of signage wrap the IFERROR formula, like this:

    = SIERREUR (INDEX (table 1::A, CORRESPONDENCE (LINE (−1, Table 1::C), 0)),"")

    Of course, you can also simply filter on column B without the need to set up a column from another table or index.

    SG

  • More than 1 SQL query with checkbox and error invalid number report

    Hi all

    I have two SQL query reports that each has an apex_item.checkbox and two processes for each report.  A report/process works very well.  It gives me an error of invalid number.

    In addition, another query SQL (editable report) gives me the following error when using the Multi line process, delete.

    ORA-06502: PL/SQL: digital or value error: character number conversion
    error ORA-06502: PL/SQL: digital or value error: character number conversion
    error
    Ok

    When I got a report from SQL query (with box and a process) and the query SQL (editable report) everything worked.  It stopped working when I added another SQL query report (with box and a process).

    A SQL query has the following in my query: apex_item.checkbox(3,email_id,'UNCHECKED') ""

    The other SQL query has the following: apex_item.checkbox(2,b.file_id,'UNCHECKED') ""

    Any help will be greatly appreciated,

    Sylvia

    Hi Reema,

    I've recreated the region and now it works!

    Thank you for this, looking at

    Sylvia

  • ORA-01722: invalid number in SQL Loader

    Hi all

    CREATE TABLE SAMPL_TABLE

    (

    ITEM_CATEGORY VARCHAR2 (30 BYTES),

    ITEM_NO VARCHAR2 (240 BYTES),

    ITEM_DESCRIPTION VARCHAR2 (240 BYTES),

    CLIENT_NAME VARCHAR2 (240 BYTES),

    CUSTOMER_NO VARCHAR2 (240 BYTES),

    VALID_AMOUNT_MONTH1 NUMBER,

    VALID_UNITS_MONTH1 NUMBER,

    VALID_BUDGET_AMOUNT_MONTH1 NUMBER,

    VALID_BUDGET_UNITS_MONTH1 NUMBER,

    ATTRIBUTE1 VARCHAR2 (240 BYTES),

    ATTRIBUT2 VARCHAR2 (240 BYTES),

    NUMBER OF VALID_RATE

    );

    Control file

    Options (Errors = 10000, Skip = 3)

    DOWNLOAD THE DATA

    INFILE ' / home/appltest/Sheet1.csv'

    BADFILE "sample.bad."

    DISCARDFILE 'sample.dsc '.

    REPLACE

    IN THE TABLE sampl_table

    fields completed by «,»

    surrounded of possibly "" "

    trailing nullcols

    (

    client_name TANK NULLIF client_name = BLANKS "RTRIM(:customer_name)."

    customer_no NULLIF CHAR customer_no = BLANKS "RTRIM(:customer_no)."

    item_no NULLIF TANK item_no = BLANKS "RTRIM(:item_no)."

    valid_amount_month1 "to_number (: valid_amount_month1, '999,999,999.99')."

    valid_units_month1 "to_number (substr (: valid_units_month1, instr(:valid_units_month1,'$') + 1), '999,999,999.99')."

    valid_budget_units_month1 "to_number (: valid_budget_units_month1, '999,999,999.99')."

    valid_budget_amount_month1 "to_number (trim (substr (: valid_budget_amount_month1, instr(:valid_budget_amount_month1,'$') + 1)), '999,999,999.99')."

    valid_rate NULLIF CHAR valid_rate = BLANKS 'RTRIM(:valid_rate) '.

    )

    Sheet1.csv

    Name of the custCust #.Article no.Item DescCategoryAmount – month 1Units - month 1Act earlyAct earlyBudget - months 1Budget - unit - months 1Rate
    Name of the custCust #.Article no.Item DescCategoryAmount – month 1Units - month 1Act earlyAct earlyBudget - months 1Budget - unit - months 1Rate
    Name of the custCust #.Article no.Item DescCategoryAmount – month 1Units - month 1Act earlyAct earlyBudget - months 1Budget - unit - months 1Rate
    REYNU1001ABC001ABC RenyuABC82611
    REYNU11028ABC123ABCRenyu123ABC29514691
    REYNU21028ABC344ABC Renyu 344ABC227063351


    Get error below

    Sheet 1: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.

    ORA-01722: invalid number

    Sheet 2: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.

    ORA-01722: invalid number

    Sheet 3: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.

    ORA-01722: invalid number

    Sheet 1: Rejected - error on the table SAMPL_TABLE, column VALID_AMOUNT_MONTH1 .

    ORA-01722: invalid number

    Sheet 2: Rejected - error on the table SAMPL_TABLE, column VALID_AMOUNT_MONTH1 .

    ORA-01722: invalid number

    Sheet 3: Rejected - error on the table SAMPL_TABLE column VALID_AMOUNT_MONTH1

    ORA-01722: invalid number

    Can you help me please?

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    Hello

    No sign of setting shaped or ' $' is seen in the data, which is the reason why I guess you used the conversions in the * ctl file.

    What is the problem with this symbol $ in the code?

    No problem with the ' $'-what I mean is that it is not necessary.

    Looking for him "$" field and exclude it from your text/number (SUBSTR) and if there is no "$" in your file, this additional training is not mandatory - why clutter up your code with unnecessary functions?

    Regarding the error you get, it is related to the format mask, you provide:

    Message #20:

    Select to_number (substr (146, instr(146,'$') + 1), '999,999,999.99') of double

    o/p: 146

    Select to_number (substr (1469, instr(1469,'$') + 1), '999,999,999.99') of double

    Error: ORA-01722: invalid number

    1. you must use "146" (text) and no 146 (number).

    2. ' 146' works because it "fits" the format mask you supplied: 999 999,999. 99. " but '1469' does not like the format mask expects one ',' as the delimiter of thousands, that is, "1 469'."

    Select to_number (substr (1, 469', instr('1,469','$') + 1), '999,999,999.99') twice;

    Similarly, in the #22 Post:

    to_number (substr (' 752,3308', instr ('752.3308', ' $') + 1), 999, 999 999,99') of double

    4 decimals are consistent with the format DP 2 mask.


    Simply remove all masks of format.

  • ORA-01722: invalid number calculation error during the treatment.

    My version of the APEX is Application Express 4.2.6.00.03

    I imported apex application 4.0.2 and his object of decision-making support in my apex.

    Its installed successfully.

    But when I try to run this application it show me this error:

    ORA-01722: invalid number calculation error during the treatment.

    Thank you guys for your help.

    I found the solution.

    There was a problem in the authentication scheme.

    I called function as return function_name in 4.0.2

    but in the Apex 4.2.6 to call a function word return is not necessary.

    He was throwing the error caused that Word back.

  • I have reinstall my Adobe Design Premium CS5, but when I enter my license number, he says it's an invalid number. What should I do?

    I have reinstall my Adobe Design Premium CS5, but when I enter my license number, he says it's an invalid number. What should I do?

    Hello

    You have allowed CS5.5 to register for your account. you need to download a good set up for Cs5.5

    Download Adobe Creative Suite 5.5 products

    Please refer to the help document can help you.

    Invalid serial number error

    Error: "this serial number is not for a product calling it" | Adobe Creative Suite

Maybe you are looking for