ORA-01722 when upgrading

Hi,
on Win 2003 I'm updating a 10.2.0.1 to 11g using Database upgrade assistant (start/program/ora 11g /...) and it fails with ORA-01722. I looked at logs and found in C:\app\Administrateur\cfgtoollogs\dbua\orcl\upgrade2\Oracle_Server.log:
The following statement will cause an "ORA-01722: invalid number"
DOC>     error if the user running this script is not SYS.  Disconnect
DOC>     and reconnect with AS SYSDBA.It is suggested then to connect as sysdba. How can I connect as sysdba when I'm running upgrade assistant in windows ? Has it any sens this solution ? Even if you start dbua in command line you can not be sys as sysdba since you are windows user (in my case Windows Administrator) ?
Thanks for help.

Hi...
have you started the database with upgrade option???
Refer to metalink doc id:-Doc ID: 435536.1
HTH
Anand

Similar Messages

  • ORA-01722 when opening a package in SQL Developer 1.2 with oracle 9iR1

    Hi,
    I use SQL Developer with Oracle Database 9i release 1.
    When I open a package in SQL Developer 1.2 (or 1.5) for editing, I receive the error ORA-01722. The package successfully opens but this message, which pops everytime, is really annoying.
    I monitored the requests sent by SQL Developer and it seems that the following request is responsible of the error :
    SELECT LINE,POSITION,TEXT,ATTRIBUTE FROM USER_ERRORS WHERE TYPE=:1AND NAME=:2
    Notice there are no spaces between ':1' and 'AND'. When executing 'by hand' the request with SQL Developer, it asks for the value of '1AND' bind variable and the value of '2'. Then, it fails to execute with... ORA-01722.
    Is it possible to avoid this bug ?
    Thank you for your help.

    We're doing rolling 2 week releases until production. Expect something new next week.

  • Error ORA-03113 when upgrading from 11.2.0.1 to 11.2.0.3

    I keep on getting this error when upgrading from 11.2.0.1 to 11.2.0.3
    [Thread-57] [ 2012-04-20 13:18:28.207 CEST ] [SummarizableStep.genSummary:409]  Generating Summary for:=Pre Upgrade ,status is:=Successful
    [Thread-57] [ 2012-04-20 13:18:28.208 CEST ] [SummarizableStep.genSummary:409]  Generating Summary for:=Oracle Server ,status is:=Failed
    oracle.sysman.assistants.util.step.StepExecutionException: ORA-03113: end-of-file on communication channel
    Upgrade failed due to running the step "Upgrading Oracle Server"
            at oracle.sysman.assistants.dbma.backend.component.SubComponent.executeSubStepImpl(SubComponent.java:738)
            at oracle.sysman.assistants.dbma.backend.component.SubComponent.executeStepImpl(SubComponent.java:585)
            at oracle.sysman.assistants.dbma.backend.component.Component.executeStepImpl(Component.java:317)
            at oracle.sysman.assistants.dbma.backend.SummarizableStep.executeImpl(SummarizableStep.java:183)
            at oracle.sysman.assistants.util.step.BasicStep.execute(BasicStep.java:210)
            at oracle.sysman.assistants.util.step.Step.execute(Step.java:140)
            at oracle.sysman.assistants.util.step.StepContext$ModeRunner.run(StepContext.java:2708)
            at java.lang.Thread.run(Thread.java:637)
    [Thread-57] [ 2012-04-20 13:18:28.209 CEST ] [SummarizableStep.executeImpl:212]  Throwing exception e from SummarizableStep
    [Thread-57] [ 2012-04-20 13:18:28.209 CEST ] [BasicStep.configureSettings:304]  messageHandler being set=oracle.sysman.assistants.util.UIMessageHandler@4805e9f1
    oracle.sysman.assistants.util.step.StepExecutionException: ORA-03113: end-of-file on communication channel
    Upgrade failed due to running the step "Upgrading Oracle Server"
            at oracle.sysman.assistants.dbma.backend.component.SubComponent.executeSubStepImpl(SubComponent.java:738)
            at oracle.sysman.assistants.dbma.backend.component.SubComponent.executeStepImpl(SubComponent.java:585)
            at oracle.sysman.assistants.dbma.backend.component.Component.executeStepImpl(Component.java:317)
            at oracle.sysman.assistants.dbma.backend.SummarizableStep.executeImpl(SummarizableStep.java:183)
            at oracle.sysman.assistants.util.step.BasicStep.execute(BasicStep.java:210)
            at oracle.sysman.assistants.util.step.Step.execute(Step.java:140)
            at oracle.sysman.assistants.util.step.StepContext$ModeRunner.run(StepContext.java:2708)
            at java.lang.Thread.run(Thread.java:637)
    [Thread-57] [ 2012-04-20 13:18:31.000 CEST ] [CompManager.isModeSet:9822]   DB Upgrade Mode Setting := 1
    [Thread-57] [ 2012-04-20 13:18:31.001 CEST ] [CompManager.isModeSet:9823]   Mode := 1 is set
    [Thread-57] [ 2012-04-20 13:18:31.001 CEST ] [SQLEngine.done:2189]  Done called
    [Thread-57] [ 2012-04-20 13:18:31.001 CEST ] [Database.getStepSQLInterface:787]  OH in database: /app/oracle/product/11.2.0.3/db_1Any clues about what could be wrong? I am planning to upgrade with the manual steps if it does not work :(

    Pl post OS details - are you using DBUA to upgrade ? Are there any errors in the database alert log ?
    ORA-00600 [kodpunp-nulltds], ORA-00600 [kokeeiix1], [600] When Upgrading To 11GR2 [ID 1367827.1]     
    HTH
    Srini

  • ORA-00955 when upgrading from Content Server 5.0.2 to Publisher?

    I am upgrading Content Server 5.0.2 to Publisher.
    After running the sw installation and having imported the publisher.pte file, I am starting the Publisher and receiving an Oracle error "ORA-00955: name is already used by an existing object". From the messages logged, it looks like the error is encountered when recreating the object PCSACTIVE.PK_PCSACTIVE (first SQL statement with "Recreating ...", all others before where "Adding ...".
    My questions:
    1. has somebody else encounteered the same error?
    2. does anybody know how to trap the SQL being executed?As the upgrade is done automatically by the Publisher when starting, I have found so far no way of checking the SQL or knowing which SQL statements are executed against the DB) when "Recreating" an object.
    Thanks in advance for your help.
    P.S. Customer Support has also been contacted, but it looks like noone else has reported this kind of problems.

    Pl post OS details - are you using DBUA to upgrade ? Are there any errors in the database alert log ?
    ORA-00600 [kodpunp-nulltds], ORA-00600 [kokeeiix1], [600] When Upgrading To 11GR2 [ID 1367827.1]     
    HTH
    Srini

  • ORA-01722 when executing a procedure

    I am executing a procedure in a package thru a nightly database job. This job has been working fine for the last several months. However recently it started abending with a ORA-01722 error. No changes have been made to the code. The procedure code follows:
    PROCEDURE p_start_batch_merge_sites IS
    p_batch_site_id tf_batch_merge_sites.master_site_id%TYPE;
    p_batch_sub_site_id tf_batch_merge_sites.subordinate_site_id%TYPE;
    p_batch_sub_site_name tf_batch_merge_sites.subordinate_site_name%TYPE;
    v_error number;
    CURSOR batch_merge_sites_cur is
    Select master_site_id, subordinate_site_id, subordinate_site_name
    from tf_batch_merge_sites
    where merge_Date_time is null;
    BEGIN
    OPEN batch_merge_sites_cur;
    LOOP
    FETCH batch_merge_sites_cur into
    p_batch_site_id, p_batch_sub_site_id, p_batch_sub_site_name;
    EXIT WHEN batch_merge_sites_cur%NOTFOUND;
    pkg_tf_merge_sites.p_merge_sites(p_batch_site_id, p_batch_sub_site_id);
    select sql_err_no into v_error
    from tf_merge_log
    where id = (select max(id) from tf_merge_log);
    IF v_error <>0 then
    close batch_merge_sites_cur;
    update tf_batch_merge_sites
    set error_message_text = 'Error in Batch Merge'
    where master_site_id = p_batch_site_id
    and subordinate_site_id = p_batch_sub_site_id;
    ELSE
    update tf_batch_merge_sites
    set error_message_text = 'Batch Merge Sites Successfully Completed',
    merge_date_time = sysdate
    where master_site_id = p_batch_site_id
    and subordinate_site_id = p_batch_sub_site_id;
    pkg_tf_merge_sites.p_delete_subordinate (p_batch_site_id, p_batch_sub_site_id, p_batch_sub_site_name);
    END IF;
    END LOOP;
    CLOSE batch_merge_sites_cur;
    END;
    One call in this procedure passing 2 number fields works ok:
    pkg_tf_merge_sites.p_merge_sites(p_batch_site_id, p_batch_sub_site_id);
    The call that is abending is passing the same 2 number fields as the above call, plus a varchar2 name field.
    pkg_tf_merge_sites.p_delete_subordinate (p_batch_site_id, p_batch_sub_site_id, p_batch_sub_site_name);
    The table structure for the tf_batch_merge_sites is as follows:
    SQL> desc tf_batch_merge_sites
    Name Null? Type
    MASTER_SITE_ID NOT NULL NUMBER(12)
    MASTER_SITE_NAME NOT NULL VARCHAR2(60)
    SUBORDINATE_SITE_ID NOT NULL NUMBER(12)
    SUBORDINATE_SITE_NAME NOT NULL VARCHAR2(60)
    MERGE_DATE_TIME DATE
    ERROR_MESSAGE_TEXT VARCHAR2(100)
    REVISION_USER_NAME NOT NULL VARCHAR2(30)
    REVISION_DATE_TIME NOT NULL DATE
    p_delete_subordinate procedure:
    PROCEDURE p_delete_subordinate(
    p_site_id IN NUMBER,
    p_subordinate_site_id IN NUMBER,
    p_site_name IN VARCHAR2
    IS
    -- PROCEDURE: p_delete_subordinate
    -- NOTES: Deletes the subordinate site after merging with the master site.
    -- HISTORY:
    -- 05-01-2003 BSS Created.
    v_batchid NUMBER;
    CURSOR subordinate_site_cur(
    p_subordinate_site_id NUMBER
    IS
    SELECT rid
    FROM se_i_entities
    WHERE id = p_subordinate_site_id
    AND entity_type = 'SITE';
    BEGIN
    BEGIN
    INSERT INTO tf_merge_sites
    (site_id,
    merged_site_id,
    merged_site_name
    VALUES (p_site_id,
    p_subordinate_site_id,
    p_site_name
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END;
    DELETE FROM tf_site_aliases
    WHERE primary_site_id = p_subordinate_site_id;
    -- OR secondary_site_id = p_subordinate_site_id;
    DELETE FROM tf_former_site_names
    WHERE site_id = p_subordinate_site_id;
    FOR k IN subordinate_site_cur(p_subordinate_site_id)
    LOOP
    DELETE FROM se_i_entity_relationships
    WHERE entity_rid_2 = k.rid
    AND entity_type_2 = 'SITE';
    END LOOP;
    DELETE FROM se_i_entities
    WHERE id = p_subordinate_site_id
    AND entity_type = 'SITE';
    DELETE FROM tf_sites
    WHERE site_id = p_subordinate_site_id;
    DELETE FROM e_masters
    WHERE id = p_subordinate_site_id;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END;
    I've looked at the data and it looks fine. Does anyone have any idea why I would get this message after it has been running fine for several months?
    Thanks!!
    Shellie Bricker

    ORA-01722: invalid number
    Cause: 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.
    Action: 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.
    Maybe you have bad data?

  • ORA-29958 when upgrading 10.2.0.4 to 11.2.0.1 on Solaris 10 using DBUA

    Hello,
    We are working in our test environment on our upgrade process from 10.2.0.4 to 11.2.0.1. I have cloned a copy of our Production database to support this effort. During the upgrade process using DBUA, we consistently receive an error. The error is encountered when DBUA is at 79% and the exact error information is:
    ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
    ORA-01031: insufficient privileges
    ORA-06512: at "SYS.DBMS_SQL", line 1053
    ORA-06512: at line 6
    I'm given the option to Ignore or Abort in DBUA.
    From the upgrade log file the error is the same:
    [Thread-104] [ 2010-11-12 13:25:07.012 PST ] [BasicStep.handleNonIgnorableError:431] ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
    ORA-01031: insufficient privileges
    ORA-06512: at "SYS.DBMS_SQL", line 1053
    ORA-06512: at line 6
    :msg
    The PUBLIC role has EXECUTE permissions on DBMS_SQL so it should have privileges.
    Here's our environment:
    $ showrev
    Hostname: hyperion
    Hostid: 846ecb2e
    Release: 5.10
    Kernel architecture: sun4v
    Application architecture: sparc
    Hardware provider: Sun_Microsystems
    Domain:=20
    Kernel version: SunOS 5.10 Generic_142909-17
    I've gone through metalink, google and some listservs that are particular to my industry and have tried many ways to solve this but still haven't been able to overcome this problem.
    Does anyone have any ideas what might be causing this?

    Thank you for the warm welcome as well as your response Srini :-) I have entered an SR with Oracle but to date they haven't been able to help so I thought I would try the community to see if anyone else has seen this problem.
    Here's the last 50 lines of output from the upgrade log:
    12 abcd
    13 abcd
    14 abcd
    15 abcd
    16 abcd
    17 abcd
    18 abcd
    19 b
    20 29d 217
    21 JNEJU4P9KpbgnzrkHXKCHLQVXhkwg2PMLq7hfy+BR2R1BLdVLsjphqEVa/Vb3ophLgWUV3kv
    22 K2yXgHALzjphTMp1ME5LLJD+GUc06ul9gkLmBIV+ngeVHtd++VxIJJrZQ0VIfx1iqTioTQEJ
    23 pmKgYDgMY1gOWfNIZ4xioKYLKhfUrOCerbZ1Ne9EUPGMyq0VmbP1otIQ5FDNn7dBHVvO26Jq
    24 m3uApMb3xTlusxYv0fwCNaRJxvxpJ3Bvx7ibtMqAJ2p2BCdY1jULaGFjZHU2U4nFTdFFQlLG
    25 hsZAFsLdHg3skNY+KK3Kd//zBAKJ84fTlwv+3RTBn+V8rUSoGM+pq2WgTccbcRtfRVbcea7O
    26 C5pzUj/cqI+ASb//p403VVOB6MKspYtXHGtg3fT2eUZHUGSzQBYy/qcrB0WjljPEIJjXxSdq
    27 s99n9VQQO/5zHtBFGSLo3lcy39pJJntO18Uy/rmBkGo/UqRsUL/aU+MTEfl2IRPqKcBzTM38
    28 tfA6lFO1boT+ZAosQsTYGg==
    29
    30 /
    Package body created.
    grant execute on xdb.xdb$acl_pkg_int to public;
    Grant succeeded.
    alter session set events='31150 trace name context forever, level 0x04';
    Session altered.
    declare
    2 cur integer;
    3 rc integer;
    4 begin
    5 cur := dbms_sql.open_cursor;
    6 dbms_sql.parse(cur,
    7 'create index xdb.xdb$acl_xidx on xdb.xdb$acl(object_value) '||
    8 'indextype is xdb.xmlindex '||
    9 'parameters(''PATH TABLE XDBACL_PATH_TAB VALUE INDEX XDBACL_PATH_TAB_VALUE_IDX'') ',
    10 dbms_sql.native);
    11 rc := dbms_sql.execute(cur);
    12 dbms_sql.close_cursor(cur);
    13 end;
    14 /
    declare
    ERROR at line 1:
    ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
    ORA-01031: insufficient privileges
    ORA-06512: at "SYS.DBMS_SQL", line 1053
    ORA-06512: at line 6
    And here's the output of utlu112i.sql. I did the purging of the recycle bin but planned on resolving the time zone and ACL information post-upgrade, as per the Oracle documentation.
    SYS@TEST11>@utlu112i
    Oracle Database 11.2 Pre-Upgrade Information Tool 11-18-2010 08:48:30
    Database:
    --> name: TEST11
    --> version: 10.2.0.4.0
    --> compatible: 10.2.0.4.0
    --> blocksize: 8192
    --> platform: Solaris[tm] OE (64-bit)
    --> timezone file: V4
    Tablespaces: [make adjustments in the current environment]
    --> SYSTEM tablespace is adequate for the upgrade.
    .... minimum required size: 1632 MB
    --> UNDOTBS1 tablespace is adequate for the upgrade.
    .... minimum required size: 310 MB
    --> SYSAUX tablespace is adequate for the upgrade.
    .... minimum required size: 1277 MB
    --> TEMP tablespace is adequate for the upgrade.
    .... minimum required size: 61 MB
    --> BANAQ tablespace is adequate for the upgrade.
    .... minimum required size: 13 MB
    Flashback: OFF
    Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]
    -- No update parameter changes are required.
    Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]
    -- No renamed parameters found. No changes are required.
    Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
    --> background_dump_dest 11.1 DEPRECATED replaced by
    "diagnostic_dest"
    --> user_dump_dest 11.1 DEPRECATED replaced by
    "diagnostic_dest"
    --> core_dump_dest 11.1 DEPRECATED replaced by
    "diagnostic_dest"
    Components: [The following database components will be upgraded or installed]
    --> Oracle Catalog Views [upgrade] VALID
    --> Oracle Packages and Types [upgrade] VALID
    --> JServer JAVA Virtual Machine [upgrade] VALID
    --> Oracle XDK for Java [upgrade] VALID
    --> Oracle Workspace Manager [upgrade] VALID
    --> EM Repository [upgrade] VALID
    --> Oracle XML Database [upgrade] VALID
    --> Oracle Java Packages [upgrade] VALID
    --> Oracle interMedia [upgrade] VALID
    --> Expression Filter [upgrade] VALID
    --> Rule Manager [upgrade] VALID
    Miscellaneous Warnings
    WARNING: --> Database is using a timezone file older than version 11.
    .... After the release migration, it is recommended that DBMS_DST package
    .... be used to upgrade the 10.2.0.4.0 database timezone version
    .... to the latest version which comes with the new release.
    WARNING: --> Database contains schemas with stale optimizer statistics.
    .... Refer to the Upgrade Guide for instructions to update
    .... schema statistics prior to upgrading the database.
    .... Component Schemas with stale statistics:
    .... SYS
    .... SYSMAN
    WARNING: --> Database contains INVALID objects prior to upgrade.
    .... The list of invalid SYS/SYSTEM objects was written to
    .... registry$sys_inv_objs.
    .... The list of non-SYS/SYSTEM objects was written to
    .... registry$nonsys_inv_objs.
    .... Use utluiobj.sql after the upgrade to identify any new invalid
    .... objects due to the upgrade.
    .... USER PUBLIC has 2 INVALID objects.
    .... USER FAPROD has 1 INVALID objects.
    .... USER SIPROD has 1 INVALID objects.
    .... USER SYS has 2 INVALID objects.
    .... USER USF_ADV has 2 INVALID objects.
    WARNING: --> Database contains schemas with objects dependent on network
    packages.
    .... Refer to the Upgrade Guide for instructions to configure Network ACLs.
    .... USER BANINST1 has dependent objects.
    .... USER SIPROD has dependent objects.
    .... USER SCTCVT06 has dependent objects.
    .... USER GEPROD has dependent objects.
    .... USER USF_FIN has dependent objects.
    .... USER WTAILOR has dependent objects.
    .... USER WFBANNER has dependent objects.
    .... USER BANSSO has dependent objects.
    .... USER ADPROD has dependent objects.
    WARNING: --> EM Database Control Repository exists in the database.
    .... Direct downgrade of EM Database Control is not supported. Refer to the
    .... Upgrade Guide for instructions to save the EM data prior to upgrade.
    WARNING:--> recycle bin in use.
    .... Your recycle bin is turned on and it contains
    .... 449 object(s). It is REQUIRED
    .... that the recycle bin is empty prior to upgrading
    .... your database.
    .... The command: PURGE DBA_RECYCLEBIN
    .... must be executed immediately prior to executing your upgrade.
    PL/SQL procedure successfully completed.
    SYS@TEST11>exit

  • ORA-12547 when upgrade database (from 10.1.0.4 to 10.2.0.4) using dbua

    Hi,
    I got error when doing the database upgrade using dbua from 10.2.0.4 home.
    It is in 15% progress of "Upgrading Oracle Server". It shows ORA-12547: TNS: lost contact.
    You can either ignore or abort.
    Any suggestion?
    Thanks in advance.
    milic

    You can almost never ignore an error message ... unless you want a failure.
    Did you read the upgrade instructions with respect to the database, listener, and oem dbconsole?

  • Encountered ORA-01722 Invalid number when query doc from  view

    Hi all,
    I have the following view.
    Select item, to_number(wo) a
    from tablea
    union all
    select item, wo
    from tablebb
    The problem rise ( ORA-01722) when I try to search for wo from the view after the view has been created. The wo field in tablea was varchar2 where user will key in the number only. And wo in tabebb is number, I can't change the column format as it is belong the my standard application table. How to solve this problem ?
    Thanks
    Lim

    sm**** wrote:
    I try to simplified my query. In fact, there are several where clause for both tables. The reason is because of the varchar2 field in WO at tablea versus the numeric field in WO for tableb. OK. The problem then is almost certainly that you have non-numeric characters in the column but you don't happen to have non-numeric characters in the columns that match all the other predicates.
    Oracle is free to apply the TO_NUMBER function before it applies some or all of the predicates you specify in your WHERE clause. If it happens to apply the TO_NUMBER on a row that has non-numeric data before it applies the condition in the WHERE clause that filters out that particular row, you'll get an error. If, on the other hand, Oracle happens to filter out the row before applying the TO_NUMBER, you'll get the results you expect. It all comes down to which plan Oracle picks. But, in general, there is no guarantee about whether you'll get an error or whether you'll get the data you want.
    You can define your own function
    CREATE OR REPLACE FUNCTION my_to_number( p_str IN VARCHAR2 )
      RETURN number
    IS
      l_num NUMBER;
    BEGIN
      l_num := to_number( p_str );
      RETURN l_num;
    EXCEPTION
      WHEN others THEN
        RETURN null;
    END;and use that instead of to_number in your query. That will catch the exception if the function is applied to a row before one of the predicates is applied.
    Justin

  • Subquery, TO_NUMBER and ORA-01722 invalid number

    I'm running into a invalid number error (ORA-01722) when I expect none.
    I have a table that stores a semester term as a VARCHAR2, all term codes are actually numbers like 200609. There is one exception which I filter out, using a subquery, to prevent the invalid number error.
    My query looks like this:
    SELECT NVL(SUM(s.balance))
    FROM (SELECT s1.term, s1.balance
    FROM student_account s1
    WHERE s1.student_id = :student_id
    AND s1.term <> 'SCRIPT') s
    WHERE TO_NUMBER(s.term) <= 200609;
    The query errors with ORA-01722.
    Now I've checked and rechecked that there isn't another bad term that is not a number.
    SELECT DISTINCT '[' || term || ']'
    FROM student_account
    WHERE student_id = :student_id;
    The error complains at line of the WHERE clause.
    I've ran just the subquery and changed the column list to select distinct term. All terms are numbers. I think that the outer WHERE clause for some reason still gets the 'SCRIPT' term. Though I've tried to verify this with no luck.
    I created a function that simply takes the term writes it to DBMS_OUTPUT and returns it as a VARCHAR2. The weird thing is then the query works. For example the outer WHERE clause becomes: WHERE TO_NUMBER(PRINT_TERM(s.term)) <= 200609
    I've also tried to move the TO_NUMBER to the subquery without any luck, same error.
    Anyone know what is going on?

    Oracle is allowed to push predicates into the subquery, so there is no guarantee that the problem row is filtered out before TO_NUMBER is called. You can get into some very interesting discussions about whether this is the right behavior from a relational theory and/or ANSI standard perspective, but you're probably stuck with the behavior (unless you want to get Oracle to rework their optimizer)
    One way to get around the problem would be to write a my_to_number function that catches the error and returns NULL if the to_number conversion fails, i.e.
    CREATE FUNCTION my_to_number( p_num IN VARCHAR2 )
      RETURN NUMBER
    IS
      l_num number;
    BEGIN
      l_num := to_number( p_num );
      RETURN l_num;
    EXCEPTION
      WHEN <<Exception whose name escapes me>> THEN
        RETURN NULL;
    END;And use that in your query.
    Justin
    Message was edited by:
    Justin Cave

  • ORA-01722: Invalid Number error coming on upgrade from  11.2.0.1.0 to  11.2.0.2.0

    Hi,
    Recently i upgraded the DB from 11.2..0.1.0 to 11.2.0.2.0 after which my queries started giving ORA:01722 error.
    The query had a left outer join between two tables based on the 2 column having different data types.
    For eg:  select * from table_1left outer join table_2 on table_2.column with number data type =
                   table_1. column with varchar datatype
    This query was working fine on 11.2..0.1.0, but started to give out error  after upgrading.

    1) the data was same in both the versions of the DB, so i don't think that first point is the reason its misfiring.
    2) For the second point if i write my query like below it works correctly in the newer version of DB.
    select * from table_1left outer join table_2 on to_char(table_2.column with number data type) =
                   table_1. column with varchar datatype
    OR
    select * from table_1left outer join table_2 on trim(table_2.column with number data type) =
                   table_1. column with varchar datatype
    3) The nls settings seems to be same for both the versions. I couldn't find any changes.
    Thanks

  • ORA-01722: invalid number Error during R12.1.1 upgrade

    Dear Experts,
    During u6678700 driiver upgrade,one of the woker failed with the following error:
    ATTENTION: All workers either have failed or are waiting:
    FAILED: file jairgmsetupmig.sql on worker 1.
    ATTENTION: Please fix the above failed worker(s) so the manager can continue.
    From the adwork001.log ,
    sqlplus -s APPS/***** @/&un_ja &batchsize 3 u03/oracle/CRP1PROD/apps/apps_st/appl/ja/12.0.0/patch/11
    5/sql/jairgmsetupmig.sql 12
    DECLARE
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at line 105
    Could not find much in internet.
    Please advice.

    From the adwork001.log ,
    sqlplus -s APPS/***** @/&un_ja &batchsize 3 u03/oracle/CRP1PROD/apps/apps_st/appl/ja/12.0.0/patch/11
    5/sql/jairgmsetupmig.sql 12
    DECLARE
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at line 105Have you tried to check line 105 in the script and see if it gives any clue?
    Could not find much in internet.
    The only hit I have found in (Bug 7120055 : FAILED: FILE JAIRGMSETUPMIG.SQL ON WORKER 1) but it does not tell much, so you may need to log a SR and get more details about this bug.
    Thanks,
    Hussein

  • ORA-01722: invalid number (Error in Application after upgrade to 3.0)

    Dear All,
    After upgrading to 3.0 I am no longer able to login to my application. The error I am seeing is:
    ORA-01722: invalid number
         Error      Could not process show_hide_memory.show_hide_collection_output procedure !
    Please help me pin-point the issue and fixed it.
    This happens in some applications but in others it doesn't...
    Regards,
    Pawel.

    I believe I have found the source of the problem!
    This is coming from the sample application which was used for the show/hide of regions example.
    The code behind the above procedure is:
    CREATE OR REPLACE
    PACKAGE show_hide_memory AS
    PROCEDURE show_hide_collection;
    PROCEDURE show_hide_collection_output;
    END;
    CREATE OR REPLACE PACKAGE BODY show_hide_memory AS
    PROCEDURE show_hide_collection AS
    l_arr apex_application_global.vc_arr2;
    l_found boolean := FALSE;
    l_collection_name VARCHAR2(255) := 'SHOW_HIDE_COLLECTION';
    BEGIN
    IF(wwv_flow_collection.collection_exists(p_collection_name => l_collection_name) = FALSE) THEN
    htmldb_collection.create_or_truncate_collection(p_collection_name => l_collection_name);
    END IF;
    l_arr := apex_util.string_to_table(p_string => v('TEMPORARY_ITEM'), p_separator => ']');
    -- If the array member count of l_arr < 3, then the following code will raise an exception
    FOR c1 IN
    (SELECT seq_id
    FROM apex_collections
    WHERE collection_name = l_collection_name
    AND c001 = l_arr(1)
    AND c002 = l_arr(2)
    AND c003 = l_arr(3))
    LOOP
    -- It exists, so delete it
    apex_collection.delete_member(p_collection_name => l_collection_name, p_seq => c1.seq_id);
    l_found := TRUE;
    END LOOP;
    IF l_found = FALSE THEN
    apex_collection.add_member(p_collection_name => l_collection_name, p_c001 => l_arr(1), p_c002 => l_arr(2), p_c003 => l_arr(3));
    END IF;
    COMMIT;
    END show_hide_collection;
    PROCEDURE show_hide_collection_output AS
    BEGIN
    htp.prn('<script type="text/javascript">' || CHR(10));
    htp.prn('<!--' || CHR(10));
    htp.prn('window.onload=function(){' || CHR(10));
    FOR c1 IN
    (SELECT c003
    FROM apex_collections
    WHERE collection_name = 'SHOW_HIDE_COLLECTION'
    AND c001 = wwv_flow.g_flow_id
    AND c002 = wwv_flow.g_flow_step_id)
    LOOP
    htp.prn('htmldb_ToggleWithImage(''' || c1.c003 || 'img'',''' || c1.c003 || 'body'');' || CHR(10));
    END LOOP;
    htp.prn('}' || CHR(10));
    htp.prn('//-->' || CHR(10));
    htp.prn('</script>' || CHR(10));
    END show_hide_collection_output;
    END;
    I guess now I have to find the bug in the above code !

  • ORA-01722: invalid number error when trying to pass a list of values

    Gurus
    We are using a function like so
    The usage for the function below is
    Select fn_st_bb_nm_uc (‘1232131312, 123213312’) from dual;
    SQL> /
    Select fn_st_bb_nm_uc ('1232131312, 123213312') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    It’s giving an invalid number error. When we pass one value it is working fine but when we pass a string of values it gives this error. I have opened an SR around this but would greatly appreciate your help
    Acc_blackbar is the table and acc_blkbr_id is of type number.
    FUNCTION fn_st_bb_nm_uc (pBB_ID_LIST VARCHAR2)
    RETURN VARCHAR2 IS
    vspcm_typ_nm_uc VARCHAR2 (2000);
    CURSOR stname
    IS
    SELECT distinct st.spcm_typ_nm_uc
    FROM
    acc_blackbar abb,
    acc_specimen_type ast, acc_procedure apr,
    acc_specimen_part asp,
    specimen_type st, procedure pr,
    proc_proc_family ppf
    WHERE abb.ACC_BLKBR_ID = apr.ACC_BLKBR_ID
    AND apr.ACC_SPCM_PART_ID = asp.ACC_SPCM_PART_ID
    AND asp.ACC_SPCM_TYP_ID = ast.ACC_SPCM_TYP_ID
    AND ast.ACC_SPCM_TYP_SPCM_TYP_ID = st.SPCM_TYP_ID
    AND apr.procdr_id = pr.PROCDR_ID
    AND pr.PROCDR_ID = ppf.PROCDR_ID
    AND abb.acc_blkbr_id in (pBB_ID_LIST) ;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(' BB LIST : ' || pBB_ID_LIST);
    FOR st IN stname
    LOOP
    vspcm_typ_nm_uc := vspcm_typ_nm_uc || ',' || st.spcm_typ_nm_uc;
    END LOOP;
    vspcm_typ_nm_uc := SUBSTR (vspcm_typ_nm_uc, 2);
    RETURN vspcm_typ_nm_uc;
    END;

    This ask tom thread covers multiple solutions:
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425]

  • ORA-01722 error, when doing a WHERE numcol IN (:P2_LIST_OF_NUMS) statement

    Hi,
    I'm trying to create a flash pie chart in APEX 3.0 and hit problems which seems to come down to my where clause.
    It appears that the :P2_LIST_OF_NUMS is not being converted correctly when I have more than one comma separated value in P2_LIST_OF_NUMS, it works fine with just one number.
    Tried this in SQL Developer entering 81,67 as my bind
    select sum(trmcnvcnt) from lstcpnsum where cpnidd1 in(&P2_LIST_OF_NUMS);
    worked fine
    Hard coded my select in APEX
    select sum(trmcnvcnt) from lstcpnsum where cpnidd1 in(81,67);
    worked fine
    But in APEX when I try to do it passing the values from a text field P2_LIST_OF_NUMS that contains 81,67 as
    select sum(trmcnvcnt) from lstcpnsum where cpnidd1 in(:P2_LIST_OF_NUMS);
    I get the ORA-01722: invalid number error.
    Works fine when P2_LIST_OF_NUMS only contains 81.
    I thought that the value of P2_LIST_OF_NUMS would just be substitued into the sql statement and then ran.
    Have I missed something here?
    Thanks
    Rich

    Rich,
    If the context permits it you might be able to specify &P2_LIST_OF_NUMS. (don't forget the period) in your SQL but a bind variable definitely will not work. For a discussion about why that is and some alternate approaches, see: Re: Search on a typed in list of values
    Scott

  • 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

Maybe you are looking for