Best way to solve ORA-01722: invalid number

Hi,
I recently had to debug a large Merge statement that was getting 'ORA-01722: invalid number' and I found the only way to do it was comment out the columns until I found the culprit :-(
Surely in this day and age there is a better way to do this? Oracle knows which column fails so it there a way of finding it more quickly?
We are using Oracle 9.2
Thanks for any top tips
Regards
Gary

you can do a cursor and trap the exception
create table t1 as select '1' col1, '2' col2 from dual union all select '1','x' from dual union all select 'x','2' from dual union all select 'x','x' from dual;
declare
  cursor c1 is select rowid,col1,col2 from t1;
  dummy number;
begin
  for r1 in c1 loop
    begin
      select to_number(r1.col1) into dummy from dual;
    exception
      when INVALID_NUMBER then
        dbms_output.put_line(r1.rowid||' col1='||r1.col1);
      end;
    begin
      select to_number(r1.col2) into dummy from dual;
    exception
      when INVALID_NUMBER then
        dbms_output.put_line(r1.rowid||' col2='||r1.col2);
    end;
  end loop;
end;
AAAKGCAAEAAAAECAAB col2=x
AAAKGCAAEAAAAECAAC col1=x
AAAKGCAAEAAAAECAAD col1=x
AAAKGCAAEAAAAECAAD col2=xHTH
Laurent Schneider
OCM DBA

Similar Messages

  • Error: ORA-01722: invalid number performing List of Values query.

    when i created a cascading select list, For the first time it worked properly then little later
    it is giving this error.
    Error: ORA-01722: invalid number performing List of Values query: "select distinct cl_name d, cl_no r from Kclient where gr_no = :P1_GRNO order by 1
    could any one please solve the problem?
    2. when i run the application. in all the items edit button is automatically seen
    including in the login screen.
    could any one identify what is the error and give me a solution.

    Is this better?
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER <> -1 order by 1or
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER != '-1' order by 1Is ROW_ID a column in your table by the way? If not, you should use ROWID (without the underscore)

  • 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

  • Microsoft Access shows "ORA-01722: Invalid number"

    Hi,
    I have seen a previous post on this problem, but none of the tips applied to my situation, so I'm asking again.
    I'm accesing Oracle 8i Personal (German Version) with Access 2002 (latest SP, on a computer with Windows 2000). Please note that I installed the latest ODBC driver from Oracle (8.1.7.6.0). When I create a table which has, say, a NUMBER(10,3) field in it, and I link it into Access using the ODBC driver, I cannot enter numbers like "1,23" into the table. The error "ORA-01722: Invalid number" is shown and the INSERT fails. If I enter the numbers like "1.23", the resulting field value is "123". The
    problem occurs, whether I use the table view, a form or VBA via ADO. Pass-Through queries (over ADO's QueryDef facility) work, however. The decimal separator is "," in both Windows and Oracle. With normal NUMBER fields everything works fine.
    When looking at the SQL log it turns out, that Access hands out a string to the ODBC driver and relies on the driver to convert it to a number. Regardless of the locale set in Windows, Access uses the dot ('1.23') as decimal separator for this string. The German version of oracle wants a comma as decimal separator as in "INSERT INTO TEST VALUES ('1,23')". From a previous post I know that ODBC specifies that all numbers must use the dot, regardless of the locale setting. So it turns out, the Oracle ODBC driver is causing the problem, not Access. But, anyway, this problem could easily be fixed by adding a "Workaround option" to the ODBC driver, that always converts dots in numbers to commas before handing it out to the backend. Another option would be, that the ODBC driver does this decision automatically by asking the backend, which separator it wants.
    Any comments greatly appreciated.
    Best regards
    Markus

    This is actually a duplicate of bug# 1938991 which says:
    "A 'Numeric settings' option has been added to the Application Options page of the ODBC Configuration screen so that the user can choose what numeric settings will be used in receiving and returning numeric data that is bound as strings. This option allows the user to choose Oracle NLS settings (the default setting and the behavior in former releases), Microsoft default regional settings (to provide a way to mirror the Oracle OLE DB driver's behavior for greater interoperability) and US numeric settings, which are necessary when using MS Access or DAO in non-US environments. In this case, setting the Numeric settings to US settings should resolve the issue, since DAO is expecting the data in US format."
    Apparently the fixed release is 9.2.0.2, 9.0.1.4 or 8.1.7.7 depending on your client version.

  • ORA-20006: ORA-01722: invalid number ORA-06512: at "APPS.WF_NOTIFICATION"

    Hi,
    I am having a wft program, which checks a function activity and depending on the value returned sends difference notifications.
    The package body completed successfully from backend and while running the workflow program it sends a notification also. But while opening the notification it gives the following error,
    ORA-20006: ORA-01722: invalid number ORA-06512: at "APPS.WF_NOTIFICATION", line 5328 ORA-06512: at line 5
    I have 3 procedures in my package body and all the 3 procedures have exceptions defined as follows, if they are using any workflow activities.
    ==========================================================
    EXCEPTION
         WHEN OTHERS THEN
              WF_CORE.context (
              'WFCustCheck',
              'MisCustDataFromTableDoc',
              document_id,
              display_type,
              document,
              document_type,
              SQLERRM
    RAISE_APPLICATION_ERROR (-20006, SQLERRM);
    ==========================================================
    But I am not able to figure out what is causing this error. What does this "line 5328 ORA-06512: at line 5" in the error message indicate?. My package body has only 600 lines. And why is the error message not displaying the procedure name? though I have defined the procedure name in the exception.
    What is the best way to get the procedure name in the error message? So that it becomes easier for identifying which procedure is causing the erro?
    Please let me know.
    Thanks

    Hi,
    Instead of the RAISE_APPLICATION_ERROR command, just replace that with RAISE;
    The error is coming out of the package that is sending the notification (WF_NOTIFICATION), which is invoked when you open the notification. I'm guessing that line 5 is the line in your code though.
    Are you using documents to send the notification, or are they purely defined in the .wft file?
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com
    NEW! - WorkflowFAQ Blog at http://thoughts.workflowfaq.com

  • 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 error in oracle 11g working fine in 9i

    Problem : I am getting ora-01722 invalid number i below mention code.Some times the procedure runs successfully but sometimes it gives error for the same parameters.The code runs fine in 9i Database.Help needed ASAP.
    CODE :
    PROCEDURE Get_HQ_for_Manager(p_person_id IN NUMBER
    ,p_maximum_level IN NUMBER
    ,io_cursor OUT dynamic_cursor) IS
    v_session_id NUMBER;
    BEGIN
    /* Create the Employee hierarchy */
    v_session_id := AMHR_GENIE_APIS.GET_SESSION_ID(p_person_id);
    OPEN io_cursor FOR
    SELECT decode(t.org_information3, 402, 'India - DVCI HR HQ', ou.NAME) HQ_Name,
    t1.org_information2 HQ_Email
    FROM hr.hr_organization_information t,
    hr_all_organization_units ou,
    hr_organization_information t1,
    (SELECT *
    FROM AMDOCS.AMHR_EMP_HIERARCHY_TMP B
    WHERE B.MNG_PERSON_ID = P_PERSON_ID
    AND B.SESSION_ID = V_SESSION_ID
    AND b.hier_level <= p_maximum_level) hier,
    per_all_people_f p_emp,
    hr_locations_all l
    WHERE t.organization_id = 342
    AND t.org_information_context = 'AMHR_COUNTRY_BY_HQ'
    AND t.org_information2 + 0 = ou.organization_id
    AND t.org_information1 = l.country
    AND t.org_information2 = t1.organization_id
    AND t1.org_information_context = 'AMHR_HQ_EMAIL_LIST'
    AND t1.org_information1 = 'HQ'
    AND p_emp.person_id = hier.person_id
    AND trunc(SYSDATE) + 0 BETWEEN p_emp.effective_start_date AND
    p_emp.effective_end_date
    AND p_emp.business_group_id <> 0
    AND (hier.ASSIGNMENT_TYPE = 'C' OR hier.ASSIGNMENT_TYPE = 'E')
    AND hier.location_id = l.location_id(+)
    AND hier.person_id <> p_person_id
    UNION
    SELECT 'India - ABSI HR HQ' HQ_Name, '[email protected]' HQ_Email
    FROM hr.hr_organization_information t,
    hr_all_organization_units ou,
    (SELECT *
    FROM amdocs.AMHR_EMP_HIERARCHY_TMP a
    WHERE a.mng_person_id = p_person_id
    AND a.session_id = v_session_id
    AND a.hier_level <= p_maximum_level) hier,
    per_all_people_f p_emp,
    hr_locations_all l
    WHERE t.organization_id = 342
    AND t.org_information_context = 'AMHR_COUNTRY_BY_HQ'
    AND t.org_information2 = ou.organization_id
    AND t.org_information1 = l.country
    AND p_emp.person_id = hier.person_id
    AND trunc(SYSDATE) + 0 BETWEEN p_emp.effective_start_date AND
    p_emp.effective_end_date
    AND p_emp.business_group_id <> 0
    AND (hier.ASSIGNMENT_TYPE = 'C' OR hier.ASSIGNMENT_TYPE = 'E')
    AND hier.location_id = l.location_id(+)
    AND t.org_information3 = 402
    AND hier.person_id <> p_person_id;
    END Get_HQ_for_Manager;

    Hi There,
    I'm having trouble seeing anything spatial in your procedure. Since this forum is for "Discussions related to Oracle Spatial, Locator, GeoRaster, Topology, Network Data Model, GeoCoder, Router, Spatial Web Services and 3D Data Model. Recommended reading: Pro Oracle Spatial" you might have better luck asking your question on one of the other forums:
    http://forums.oracle.com/forums/category.jspa?categoryID=18
    A line number for the error would help too.
    Best of luck,
    Matt

  • ORA-01722: invalid number error. In Update

    create or replace procedure San_Test (sInNum varchar2, outMsg out varchar2)
    is
    begin
    update mtest set
    mname = 'Success'
    where id in (sInNum);
    commit;
    outMsg :='Success';
    exception
    when others then
    outMsg :='Err';
    dbms_output.put_line(sqlerrm);
    end;
    This is my test sp where i am getting ORA-01722: invalid number error.
    Which is because the column data type is Number of ID and i have sInNum parameter as varchar2.. How can i achieve this ?
    I don't have other way to do this please help.

    Great demonstration for SQL INJECTION, was that part of your OCP training?
    CREATE TABLE mtest (id NUMBER, mname VARCHAR2(255));
    INSERT INTO mtest VALUES (1, 'test');
    INSERT INTO mtest VALUES (2, 'test2');
    COMMIT;
    CREATE OR REPLACE PROCEDURE san_test (sinnum VARCHAR2, outmsg OUT VARCHAR2)
    IS
       mnum     VARCHAR2 (10);
       strsql   VARCHAR2 (250);
    BEGIN
       mnum := REPLACE (sinnum, '''', '');
       strsql :=
           'update mtest set
    mname = ''Success''
    where id in (' || mnum || ')';
       EXECUTE IMMEDIATE strsql;
       COMMIT;
       outmsg := 'Success';
    EXCEPTION
       WHEN OTHERS
       THEN
          outmsg := 'Err';
          DBMS_OUTPUT.put_line (SQLERRM);
    END;
    SELECT *
      FROM mtest;
            ID MNAME
             1 test
             2 test2And now for the fun part:
    SET SERVEROUTPUT ON
    DECLARE 
      v_put_msg VARCHAR2(255);
    BEGIN
      san_test('1) OR (1=1', v_put_msg);
      dbms_output.put_line(v_put_msg);
      COMMIT;
    END;
    SELECT *
      FROM mtest;
            ID MNAME
             1 Success
             2 SuccessC.

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

  • SQL*Loader- Records Rejected - Error on table ORA-01722: invalid number

    Getting the following errors :
    Please tell me where I am going wrong?
    Attached is the log file and snippets of datafile along with the control file !!
    Also please direct me how can i upload 4900 records at one go?
    SQL*Loader: Release 11.1.0.7.0 - Production on Fri Oct 14 03:06:06 2011
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Control File: sample.ctl
    Data File: Cities.csv
    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 CITY, 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 1: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 2: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 3: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 4: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 5: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 6: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 7: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 8: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 9: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 10: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 11: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 12: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 13: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 14: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 15: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 16: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 17: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 18: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 19: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 20: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 21: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 22: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 23: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 24: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 25: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 26: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 27: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 28: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 29: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 30: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 31: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 32: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 33: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 34: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 35: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 36: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 37: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 38: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 39: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 40: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 41: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 42: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 43: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 44: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 45: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 46: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 47: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 48: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 49: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 50: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    Record 51: Rejected - Error on table CITY, column POPULATION.
    ORA-01722: invalid number
    MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
    Table CITY:
    0 Rows successfully loaded.
    51 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: 64
    Total logical records rejected: 51
    Total logical records discarded: 0
    Run began on Fri Oct 14 03:06:06 2011
    Run ended on Fri Oct 14 03:06:12 2011
    Elapsed time was: 00:00:06.18
    CPU time was: 00:00:00.03
    my control file (sample.ctl):
    load data infile 'Cities.csv'
    into table city
    fields terminated by ','
    (id integer external,
    name char(35) enclosed by "'",
    countrycode char(3) enclosed by "'",
    population integer external terminated by '\n'
    my datafile (Cities.csv) (it contains 4900 records, but I am showing 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!!

    Look that when I change a little bit your datafile as follows
    1,'Kabul','AFG',1780000
    2,'Qandahar','AFG','237500'
    3,'Herat','AFG','186800'  I got the same error (2 last rows rejected for the same error invalid number)
    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.09Population value within the data file should be a number
    Best regards
    Mohamed Houri

  • Sdo_util error code ORA-01722: invalid number in Oracle 11g R2

    Dear every one,
    Greetings.
    Hi. As mentioned in the title, I met a strange problem when I was trying to extrude the 2D objects into 3D. The error code says ORA-01722: invalid number. Then, to eliminate the possibility that the code would be wrong, I took the sample code from the ORACLE document about sdo_util.extrude
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_util.htm#SPATL1230
    the same error appeared. However, I tested the same code through the SQLDeveloper in Linux (where the 11g R2 is located) to perform the same thing in my other database in windows server 2008 where 11g R1 was installed. Works fine.
    Is there any particular configuration I should do or I have done wrong. Any one knows, please help. Thanks.
    Jun

    Hi,-
    Please use w/o 'FALSE' parameter for 11.2.0.1.0 release:
    SELECT SDO_UTIL.EXTRUDE(
    SDO_GEOMETRY(
    2003,
    null,
    null,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(5, 1,8,1,8,6,5,7,5,1)),
    SDO_NUMBER_ARRAY(0,0,0,0,0),
    SDO_NUMBER_ARRAY(5,10,10,5,5),
    0.005) from dual;
    In 11.1.0.7 release, you need to use 'FALSE' parameter:
    SELECT SDO_UTIL.EXTRUDE(
    SDO_GEOMETRY(
    2003,
    null,
    null,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(5, 1,8,1,8,6,5,7,5,1)),
    SDO_NUMBER_ARRAY(0,0,0,0,0),
    SDO_NUMBER_ARRAY(5,10,10,5,5),
    'FALSE',
    0.005) from dual;
    We fixed this confusion for the next releases so that both interfaces can be used
    and 'FALSE' parameter will be ignored.
    Best regards
    baris

  • EXECUTE IMMEDIATE ORA-01722 invalid number

    hi all
    i have a plsql procedure in which the following statement which gives this error ORA-01722: invalid number
    sql_stmt :='UPDATE Student set '||stu_gradefor||'=TO_NUMBER('||stu_marks||') where UserID='||stu_UID;
    EXECUTE IMMEDIATE sql_stmt;
    here all variables (stu_marks,stu_gradefor and stu_UID) are varchar2 coming from different procedure(form) but in the table named Student column HW1 (stu_gradefor) is of datatype number.
    I have tried a lot but could not make it to work. Is it that we cannot enter an number through EXECUTE IMMEDIATE? If Possible can somebody help me with this?
    Thanks a lot.
    Regards
    Jyoti

    create table Student(UserID varchar2(8) not null, HW1 number(3) , HW2 number(3) , PA1 number(3) , ................);
    create table Domain(R_Domain varchar2(11) not null, R_Status char(1) not null, R_Date Date null,R_Value varchar2(11) null, R_Mean varchar2(300) not null);
    insert into Domain( R_Domain, R_Status, R_Value, R_Mean )values(
         'Term','t','PA1','First Programming Assignment');
    Full names for HW1, HW2, PA1....are in the Domain table. so in variable stu_gradefor we get the R_Value.
    this is true :variable stu_marks is not actually a number, so the TO_NUMBER is causing the error. stu_marks is of datatype varchar2 but the field HW1,.. are all expecting a numeric value.
    i tried SELECT TO_NUMBER(stu_marks) INTO gmark FROM DUAL;
    sql_stmt :='UPDATE Student set '||stu_gradefor||'=(:1) where UserID='||stu_UID;
    EXECUTE IMMEDIATE sql_stmt using gmark;
    where gmark is a number but noting works.same error
    This can be true:the column userid is a varchar2 column with a mix of numeric and alpha numeric values. userid value that i inserted was'12345678'
    i there any other way to handle this situation?
    Thanks for replying
    Jyoti

  • Recieving ORA-01722 invalid number error while creating a materialized view

    Hi,
    I am receiving a ORA-01722 invalid number error while creating a materialized view. when run the select statement of the view i don't get any error, but when i use the same select statement to create a materialized view i receive this error. Could any please help in resolving this error. Here is the code i am using to create a materialized view.
    CREATE MATERIALIZED VIEW MV_EBS_CH_CLOSED
    REFRESH FORCE ON DEMAND
    AS
    SELECT DISTINCT kr.request_id, org.org_unit_name,
    ebs_ch_ticket_type (kr.request_id) ticket_type,
    DECODE
    (kr.status_code,
    'CLOSED_SUCCESS', kr.last_update_date,
    'IN_PROGRESS', (SELECT MAX (start_time)
    FROM ebs_ch_datastore ecd1
    WHERE kr.request_id = ecd1.request_id
    AND workflow_step_name =
    'Final BA Review and Deployment Exit Criteria')
    ) closed_date,
    substr(krhd.visible_parameter12,1,10) siebel_start_date,
    kr.creation_date itg_start_date
    FROM kcrt_requests kr,
    kcrt_request_types krt,
    kcrt_req_header_details krhd, kcrt_request_details krd1,
    (SELECT koum.user_id user_id,
    DECODE (koup.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    koup.org_unit_name
    ) org_unit_name
    FROM krsc_org_unit_members koum, krsc_org_units koup
    WHERE 1 = 1
    AND 'Y' = koup.enabled_flag
    AND koum.org_unit_id = koup.org_unit_id
    AND EXISTS (
    SELECT 'X'
    FROM krsc_org_units kouc
    WHERE koup.org_unit_id = kouc.org_unit_id
    START WITH kouc.parent_org_unit_id =
    ANY (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units1
    WHERE 'Clearinghouse' =
    org_unit_name)
    CONNECT BY kouc.parent_org_unit_id =
    PRIOR kouc.org_unit_id)
    UNION
    SELECT kou.manager_id user_id,
    DECODE
    (kou.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    kou.org_unit_name
    ) org_unit_name
    FROM krsc_org_units kou
    WHERE 'Y' = kou.enabled_flag
    START WITH kou.parent_org_unit_id =
    (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units2
    WHERE 'Clearinghouse' = org_unit_name)
    CONNECT BY kou.parent_org_unit_id = PRIOR kou.org_unit_id) org
    WHERE krt.request_type_id = kr.request_type_id
    AND krt.request_type_name IN ('Bug Fix', 'IT Enhancement')
    and kr.REQUEST_ID = krd1.request_id
    and krd1.batch_number = 1
    AND kr.request_id = krhd.request_id
    AND org.user_id in (krd1.parameter4, krd1.parameter5, krd1.parameter7)
    AND ( 'CLOSED_SUCCESS' = kr.status_code
    OR 'IN_PROGRESS' = kr.status_code
    AND kr.request_id IN (
    SELECT request_id
    FROM (SELECT DISTINCT request_id,
    MAX
    (start_time)
    closed_date
    FROM ebs_ch_datastore
    WHERE 'Final BA Review and Deployment Exit Criteria' =
    workflow_step_name
    GROUP BY request_id))
    Thanks,
    Shaik Mohiuddin

    This error occurs when you try to create a materialized view , but if you run the sql the results are perfectly fine. Well it happend to me also and to fix this I made sure all the coulmns have the same data type which are used in joins or in where clause.
    use
    where
    to_number(col1)=to_number(col2) and to_number(col3)=to_number(col4)
    hope this helps..

  • Error Message - ORA-01722 Invalid Number

    Hello:
    I have the following situation. When I create an organization, a record is inserted into the following table, AGREEMENTS, and populates four fields.
    I have an update form which selects the organization from the AGREEMENTS table so the user can populate the rest of the table. In addition, on this form, there is a drop-down box which allows the user to select the name of a legal document along with the version of the document in which the user needs to select. This select list is created via an LOV joining three tables. The item name for this select list is :P6_DOCUMENT.
    The code for the LOV is:
    SELECT S.DOC_NAME||' - '|| O.VERSION_NO AS DOC, O.ORG_DOC_CURR_KEY
    FROM SUPPORTING_DOCS S,
         ORG_DOC_CURR_VER O,
         AGREEMENTS H
    WHERE
        S.DOC_TYPE = 'HISA'
    AND S.SUPPORTING_DOC_KEY = O.SUPPORTING_DOC_KEY
    AND H.ORG_KEY_LE = O.ORG_KEY
    AND O.ORG_KEY=:P6_ORG_KEY_LEWhen the user completes the form, the SUBMIT process is a PL/SQL block consisting of an UPDATE statement to update the AGREEMENTS table based on the selected organization and an INSERT statement to insert a record into the AGREEMENTS_DOC table to store the value stored in :P7_DOCUMENT.
    Ok, now here is where my problem starts.
    When I first bring up the form and I select the organization I want to update, I click the Search button to find the organization and I receive the following error message: ORA-01722 Invalid Number.
    At this point all I'm doing is a basic search. There is no insert/update or anything going on. I'm not understanding why I would be receiving this error message.
    The search is based on the database column ORG_KEY_LE whose datatype is NUMBER.
    In my application, the item assigned to ORG_KEY_LE is P6_ORG_KEY_LE.
    I have a PL/SQL block process created (On Load-Before Header) in the Page Rendering area of my page definition. The PL/SQL code that is written is:
    BEGIN
    IF :P6_SEARCH_ORG != '0' THEN
    :P6_ORG_KEY_LE := :P6_SEARCH_ORG;
    END IF;
    END;I then have an Item created, :P6_SEARCH_ORG, which is a Select List. In the LOV portion of the page for this item, I have the following:
    select ORG_KEY_LE display_value, ORG_KEY_LE return_value
    from AGREEMENTS
    order by 1The reason for using this table is because this table contains the newly created organization which needs to be updated with the remaining columns of data.
    I then have a Search button in the Button area which has the following settings:
    Button Position: Region Template Position #CHANGE#.
    Condition Type: Value of Item in Express 1 is NULL.
    Expression 1: :P6_ORG_KEY_LE.
    To troubleshoot this problem, I created two pages, one page to do the UPDATE and the second page to do the INSERT.
    The SEARCH functionality in both pages are identical.
    When I run my UPDATE page, which only involves updating the missing fields, the process works. I have my search box, I'm able to search for the organization, make my updates, and I'm good.
    When I run my INSERT page, which involves inserting the record with the assigned document, I receive the error message after I click the SEARCH button. In order to INSERT the record into this table, I first need to SELECT the organization that was UPDATED in the AGREEMENTS table (using the UPDATE page described in above paragraph). When I select the organization, the user can then assign the appropriate legal document to the organization and insert the record into the AGREEMENTS_DOC table.
    Can someone help me with this error message? I'm not sure why I am able to perform my SEARCH on a page with the UPDATE statement, not able to perform the SEARCH on the page with my INSERT statement, and not be able to perform the SEARCH on the page that combines the UPDATE and INSERT statements.
    I did some more troubleshooting and I do believe my SUBMIT process which contains the INSERT statement is the issue. I created a fourth page which doesn't have a SUBMIT process. I brought up the form, searched for my organization and the information for that organization appeared. The problem is definately with my UPDATE/INSERT process.
    The PL/SQL block for the Submit process is the following:
    BEGIN
    update
        MDD.HISA_AGREEMENTS
         set
           LAST_UPDATED_BY=V('APP_USER'),
           APPROVER_SALUTATION=:P6_APPROVER_SALUTATION,
           APPROVER_FIRST_NAME=:P6_APPROVER_FIRST_NAME,
           APPROVER_MIDDLE_INITIAL=:P6_APPROVER_MIDDLE_INITIAL,
           APPROVER_LAST_NAME=:P6_APPROVER_LAST_NAME,
           APPROVER_NAME_SUFFIX=:P6_APPROVER_NAME_SUFFIX,
           APPROVER_EMAIL_ADDR=:P6_APPROVER_EMAIL_ADDR,
           SPONSOR_EMAIL_ADDR=:P6_SPONSOR_EMAIL_ADDR,
           APPROVER_TITLE=:P6_APPROVER_TITLE
    where
          ORG_KEY_LE=:P6_ORG_KEY_LE
    INSERT INTO
        HISA_AGREEMENT_DOCS
          (HISA_AGREEMENT_DOC_KEY,
           ORG_KEY_LE,
           APPLICATION_KEY,
           STATUS,
           STATUS_DATE,
           CREATED_BY,
           ORG_DOC_CURR_KEY)
    VALUES
          (HISA_AGREEMENT_DOC_KEY_SEQ.NEXTVAL,
           :P6_ORG_KEY_LE,
           :P6_APPLICATION_KEY,
           'C',
           SYSDATE,
           V('APP_USER'),
           :P6_DOCUMENT)
    END;There is something wrong with the above statement and I do not understand what it could be. Can someone help?
    Thanks for the help.

    Hi,
    I believe you are on to something.
    The select list for item :P6_DOCUMENT appears when I first bring up the form. When I select my organization and receive the error message, I clicked on the Session in the Developer's bar. The value in item/field :P6_DOCUMENT shows %null%.
    This is the path in which my user would like to accomplish her task:
    1. Select an organization
    2. Display the information for that organization from the AGREEMENTS table
    3. Enter the data for the remaining fields in the AGREEMENTS table
    4. Select the document (:P6_DOCUMENT) from the drop-down.
    5. Click Submit
    6. Update the AGREEMENTS table with data entered in #3.
    7. Insert a record into the AGREEMENTS_DOC table with the selection from #4.
    Somehow I need the :P6_DOCUMENT field not to show the %null% during the SEARCH functionality. I think that is causing the problem.
    How do I fix this?

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

Maybe you are looking for

  • From iPhoto to Aperture and now back to iPhoto?

    Hi, all: About 15 months ago, I bought and dl'd a copy of Aperture from the App Store because it was so much cheaper than retail.  What I've realized, though, is that I bit off more than I can chew, in terms of features and learning curve, and I woul

  • Problem with Adobe X Pro when scanning horizontal tables

    My problem is the following: When trying to scan physical documents which contain tables (Excel type) oriented horizontally along the paper, using Adobe Acrobat X Pro, it prints an incomplete table with vertical orientation (basically it forces horiz

  • GC most appropriate for 200 MS Terminal Sessions running large Applet

    We are load testing a J2EE application using a tool called App Loader. The client for this J2EE application is a large applet which runs from 60 mb of jars. We are running the applet in IE 6 on W2k3 X64 Enterprise in each of 200 Terminal Sessions on

  • My HD is full, but my I'm showing 30 GB of audio and 70 GB of movies that I cannot find.

    I'm still on 10.7.4 and under 'About this Mac' 'storage' shows the above amount of files, and more, that i cannot find via any searches of typical extensions.  I deleted, and emptied trash, months ago, of all of these file types, and I never had so m

  • MyFaces and ajax4jsf

    Does anyone work with MyFaces and ajax4lsf ? I added ajax4jsf to my project very easily, but I have encountered 2 weird issues: 1) Some of the links in my data tables got an additional space (or some other white character) making the links apear like