To_number function return Invalid number

Dear All,
We have problem recently regarding one of our query that using to_number function. It worked smoothly for 4-5 years until recently our client complaints that the query is returning error ORA-01722: invalid number.
This is the SQL Script -> SELECT * FROM <table_name> WHERE to_number(b) between :param1 and :param2;
* Column b is defined as VARCHAR2(20)
First thing that come to my mind is this error is due to invalid value entered by user. Using the solutions provided by users in this forum and internet, I created SQL a function that checks whether the value is numeric or not.
So, when I run the query (+SELECT b from <table_name> WHERE is_numeric(b) = 0 AND ROWNUM < 20+) this is the result that I get.
b
251567
251568
251569
251570
251571
(Up to 11 record; value from 251567 - 251577)
Is there any limitation on the maximum value that can be converted using to_number* function?*
I have search the solutions over the internet and I accept the solution/recommendation that we should not store numeric value on varchar/char column; but I hope somebody can explain why I can't use to_number to convert the above figures to numeric, because when I execute SELECT to_number('251567') FROM DUAL it doesn't returned any error)
Thank you in advance for any help or clarification on this issue.
Edited by: user5535734 on Apr 16, 2012 10:46 PM

Funny answer, Billy!
Sounds like: The world is evil, so you have 3 choices:
1. Implement a good world
2. Be a bad guy, too
3. Live with that bad world and its consequences
I guess, 930427 only asked for some protection...
If one has to deal with two external system to move data from one to another - you can't change either of these systems (1 or 2) and you can't afford to fail (3).
Sometimes blanks inside the numeric values are the reason for INVALID NUMBER, i.e. "123 456".
as simple
to_number(replace(VALUE_CHAR, ' ', NULL))
may help...

Similar Messages

  • XMLType toobject return invalid number while providing the XML Schema/DTD

    We are exploring an option of converting XML into an oracle object and found toobject procedure that does the job. It works fine without XML Schema and provides XML data as oracle object. But it takes more time in parsing the XML since it uses canonical mapping. I hope by providing XML Schema we can improve the performance of this procedure. However when we use toobject with XML Schema it reports error as INVALID NUMBER irrespective of the input XML changes. Could anyone help me in this regard?

    Sorry
    The option of using toObect() to get an instance of the object that was creaed by regidsteing an XML Schema with the database, or which is associated with an XML Schema that has been registered with the database is depricated and will be removed in the next release. The main reason for this is that we reserve the right to change the structure, naming conventions or any other aspects of the object model we dervie from an XML schema, even as a result of a one-off patch, and consequently any code that was written to rely on this mapping would be broken on a regular basis.
    We do gurantee that code that uses the XML abstraction (eg XPATH/XQUERY) to access the content of the XML will work unchanged...
    In you case you have 2 options...
    1. Use the canonical mapping mechansim
    2. Write code that instantiates the objects from the outpiut of an XMLTable...
    -M

  • Pl/sql function replying invalid number error

    Hi,
    I don't know if it's the late hour or I'm just missing something...
    I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
    Please let me know what am I missing...
    Thanks!
    create or replace
    FUNCTION GAMES(
    MINUTE_PLAYED IN NUMBER,
    HOME_GOALS IN NUMBER,
    AWAY_GOALS IN NUMBER)
    RETURN NUMBER IS
    HOME VARCHAR2(100);
    AWAY VARCHAR2(100);
    RELEVANT_GAMES NUMBER;
    BEGIN
    HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
    AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
    SELECT COUNT(*) INTO RELEVANT_GAMES
    FROM FINISHED_GAMES
    WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
    RETURN RELEVANT_GAMES;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END GAMES;

    869206 wrote:
    Hi,
    I don't know if it's the late hour or I'm just missing something...
    I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
    Please let me know what am I missing...
    Thanks!
    create or replace
    FUNCTION GAMES(
    MINUTE_PLAYED IN NUMBER,
    HOME_GOALS IN NUMBER,
    AWAY_GOALS IN NUMBER)
    RETURN NUMBER IS
    HOME VARCHAR2(100);
    AWAY VARCHAR2(100);
    RELEVANT_GAMES NUMBER;
    BEGIN
    HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
    AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
    SELECT COUNT(*) INTO RELEVANT_GAMES
    FROM FINISHED_GAMES
    WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
    RETURN RELEVANT_GAMES;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END GAMES;eliminate EXCEPTION handler!
    do NOT rely on implicit datatype conversion
    use TO_CHAR or TO_NUMBER as needed.
    HOME & HOME_GOALS are different datatype

  • Column Function Return Type Number is forcing to cast to Decimal

    Hi - I am using Oracle 11g Release 11.2.0.2.0 and ODP.NET 4.112.3.0.
    Whenever I am trying to execute a package query with column function and return type is number, it is throwing cast exception whenever I am trying to cast it as GetInt32.
    The workaround we have for now is to get it decimal and cast to Int32, this is going to be painful moving forward because it means that we have to check each of our packages and need to know if each package has column function and do this special casting.
    Is this a known bug?

    Oracle Number is 6.
    Run the below script to your machine and the sample code below so you can see what I am talking about.
    --drop table aninalfarm;
    --drop table birdfarm;
    --drop public synonym animalfarm;
    --drop public synonym birdfarm;
    --drop public synonym birdfarm_Pkg;
    --drop public synonym animalfarm_Pkg;
    create table animalfarm
            (code                                 NUMBER(6),
            description                        varchar2(10));
    create table birdfarm
           (code                               number(6),
           description                         varchar2(10));
    create public synonym  animalfarm for db.animalfarm;
    create public synonym  birdfarm for db.birdfarm;
    grant select, delete, insert, update on  animalfarm to public;
    grant select, delete, insert, update on  birdfarm to public;
    delete from animalfarm;
    delete from birdfarm;
    commit;
    insert into animalfarm (code, description) values(111122, 'Horse');
    insert into animalfarm (code, description) values(111133, 'Chicken');
    insert into animalfarm (code, description) values(111144, 'Cow');
    insert into animalfarm (code, description) values(111155, 'Pig');
    insert into animalfarm (code, description) values(111166, 'Sheep');
    insert into birdfarm (code, description) values(222, 'Pigeon');
    insert into birdfarm (code, description) values(333, 'Sparrow');
    insert into birdfarm (code, description) values(444, 'Chickadee');
    insert into birdfarm (code, description) values(555, 'Blue Jay');
    insert into birdfarm (code, description) values(666, 'Loon');
    commit;
    create or replace package birdfarm_Pkg is
    function get_key_from_desc(bird_name_in in birdfarm.description%type) return number;
    end birdfarm_Pkg;
    create or replace package body birdfarm_Pkg is
    function get_key_from_desc(bird_name_in in birdfarm.description%type) return number is
    RETURN_VALUE birdfarm.code%TYPE;
    BEGIN
           select code into RETURN_VALUE from birdfarm where description = bird_name_in;
           return RETURN_VALUE;
    end get_key_from_desc;
    END birdfarm_Pkg;
    create or replace package animalfarm_Pkg is
    --region Define Record Type for Strong Type REF CURSOR
    TYPE AnimalFarmRecord is
      RECORD(
                      code animalfarm.code%type,
          description animalfarm.description%type,
                      birdfarm_code birdfarm.code%type
    --endregion
    TYPE animalfarmCur is REF CURSOR RETURN AnimalFarmRecord;
    procedure get_code_two_ways(cur_OUT OUT animalfarmCur);
    end animalfarm_Pkg;
    create or replace package body animalfarm_Pkg is
    procedure get_code_two_ways(cur_OUT OUT animalfarmCur) is
    BEGIN
      open cur_OUT for
           select animalfarm.code,
                  animalfarm.description,
                  birdfarm_pkg.get_key_from_desc('Pigeon') birdfarm_code
           from animalfarm
           order by code;
    end get_code_two_ways;
    END animalfarm_Pkg;
    create public synonym birdfarm_Pkg for db.birdfarm_Pkg;
    grant execute on birdfarm_Pkg to public;
    create public synonym animalfarm_Pkg for db.animalfarm_Pkg;
    grant execute on animalfarm_Pkg to public;
    See the sample code below:
                 var conn = new OracleConnection(OraDB);
                conn.Open();
                conn.ClientId = "Sample";
                var command = new OracleCommand
                                      Connection = conn,
                                      CommandText = "DB.animalfarm_Pkg.get_code_two_ways",
                                      CommandType = CommandType.StoredProcedure
                command.Parameters.Add(new OracleParameter
                                       ParameterName = "cur_OUT",
                                       OracleDbType = OracleDbType.RefCursor,
                                       Direction = ParameterDirection.Output
                OracleDataReader dr = command.ExecuteReader(); // C#
                dr.Read();
                var code =dr.GetInt32(dr.GetOrdinal("Code")); //This is ok
                var description = dr.GetString(dr.GetOrdinal("Description"));
                var codeError = dr.GetInt32(dr.GetOrdinal("birdfarm_code"));//Throw invalid cast exception
                                                                            //because it is column function
                conn.Close();
                conn.Dispose();

  • New table without statistics returns invalid number of rows

    Hi,
    I've been searching for a while now for an explanation for the following "problem"
    We have an Oracle 11.1.0.7 database on AIX5.3
    In this database we have two tables, called KRT_PRODUCTS_INFO and KRT_STRUCTURES_INFO ( the table name don't really matter ).
    The scenario is as following:
    If we recreate these tables like:
    CREATE TABLE KRT_PRODUCT_INFO_BUP AS SELECT * FROM KRT_PRODUCT_INFO;
    DROP TABLE KRT_PRODUCT_INFO CASCADE CONSTRAINTS;
    CREATE TABLE KRT_PRODUCT_INFO (...) TABLESPACE PIM_DATA NOLOGGING NOCOMPRESS NOCACHE NOPARALLEL MONITORING;
    CREATE INDEX KRT_PRODUCT_INFO_X1 ON KRT_PRODUCT_INFO (PRODUCT_NUMBER) NOLOGGING TABLESPACE PIM_DATA NOPARALLEL;
    CREATE INDEX KRT_PRODUCT_INFO_X2 ON KRT_PRODUCT_INFO (PIM_ARTICLEREVISIONID) NOLOGGING TABLESPACE PIM_DATA NOPARALLEL;
    INSERT INTO KRT_PRODUCT_INFO (SELECT * FROM KRT_PRODUCT_INFO_BUP);
    COMMIT;
    CREATE TABLE KRT_STRUCTURE_INFO_BUP AS SELECT * FROM KRT_STRUCTURE_INFO;
    DROP TABLE KRT_STRUCTURE_INFO CASCADE CONSTRAINTS;
    CREATE TABLE KRT_STRUCTURE_INFO (...) TABLESPACE PIM_DATA NOLOGGING NOCOMPRESS NOCACHE NOPARALLEL MONITORING;
    CREATE INDEX KRT_STRUCTURES_X1 ON KRT_STRUCTURE_INFO (STRUCTURE_GRP_REV_ID) NOLOGGING TABLESPACE PIM_DATA NOPARALLEL;
    CREATE INDEX KRT_STRUCTURES_X2 ON KRT_STRUCTURE_INFO (STRUCTURE_GRP_IDENTIFIER) NOLOGGING TABLESPACE PIM_DATA NOPARALLEL;
    CREATE INDEX KRT_STRUCTURES_X3 ON KRT_STRUCTURE_INFO (STRUCTURE_GRP_ID) NOLOGGING TABLESPACE PIM_DATA NOPARALLEL;
    INSERT INTO KRT_STRUCTURE_INFO (SELECT * FROM KRT_STRUCTURE_INFO_BUP);
    COMMIT;
    and we run a complex query with these two tables, this query only return a couple of rows ( exactly 24 !!! )
    If we however generate statistics on these tables after creation, the correct number of rows is returned, being 1.167.991 rows
    The statistics are gathered using:
    BEGIN
    SYS.DBMS_STATS.GATHER_TABLE_STATS (
    OwnName => 'PIM_KRG'
    ,TabName => 'KRT_PRODUCT_INFO'
    ,Estimate_Percent => NULL
    ,Method_Opt => 'FOR ALL COLUMNS SIZE REPEAT '
    ,Degree => NULL
    ,Cascade => TRUE
    ,No_Invalidate => FALSE);
    END;
    BEGIN
    SYS.DBMS_STATS.GATHER_TABLE_STATS (
    OwnName => 'PIM_KRG'
    ,TabName => 'KRT_STRUCTURE_INFO'
    ,Estimate_Percent => NULL
    ,Method_Opt => 'FOR ALL COLUMNS SIZE REPEAT '
    ,Degree => NULL
    ,Cascade => TRUE
    ,No_Invalidate => FALSE);
    END;
    /I can imagine that the 'plan' for the query used is wrong because of missing statistics.
    But I can't imagine that it would actually return an incorrect number of rows.
    I tested this behaviour in Toad and sqlplus ( first thought it was Toad ), and both behave the same.
    Another fact is, that the "problem" is NOT reproducable on our TEST environment, that runs on Oracle 11.1.0.7 on Windows2008
    Just to be sure this is the "complex" query used. It is not developed by me, and I think it looks somewhat strange but that shouldn't matter:
    SELECT sr."Identifier" STRUCTURE_IDENTIFIER
    , ar_i."Identifier" ITEM_NUMBER
    , SUM (REPLACE (NVL (s.HIDE_LE10, 0) + NVL (p.HIDE_LE10, 0), 2, 1))
    hide_le10
    , SUM (REPLACE (NVL (s.HIDE_LE30, 0) + NVL (p.HIDE_LE30, 0), 2, 1))
    hide_le30
    , SUM (REPLACE (NVL (s.HIDE_LE40, 0) + NVL (p.HIDE_LE40, 0), 2, 1))
    hide_le40
    , SUM (REPLACE (NVL (s.HIDE_LE50, 0) + NVL (p.HIDE_LE50, 0), 2, 1))
    hide_le50
    , SUM (REPLACE (NVL (s.HIDE_LE55, 0) + NVL (p.HIDE_LE55, 0), 2, 1))
    hide_le55
    , SUM (REPLACE (NVL (s.HIDE_LE60, 0) + NVL (p.HIDE_LE60, 0), 2, 1))
    hide_le60
    , SUM (REPLACE (NVL (s.HIDE_LE70, 0) + NVL (p.HIDE_LE70, 0), 2, 1))
    hide_le70
    , SUM (REPLACE (NVL (s.HIDE_LE75, 0) + NVL (p.HIDE_LE75, 0), 2, 1))
    hide_le75
    , SUM (REPLACE (NVL (s.HIDE_LE58, 0) + NVL (p.HIDE_LE58, 0), 2, 1))
    hide_le58
    , SUM (REPLACE (NVL (s.HIDE_LE80, 0) + NVL (p.HIDE_LE80, 0), 2, 1))
    hide_le80
    , SUM (REPLACE (NVL (s.HIDE_LE90, 0) + NVL (p.HIDE_LE90, 0), 2, 1))
    hide_le90
    , SUM (REPLACE (NVL (s.HIDE_LE92, 0) + NVL (p.HIDE_LE92, 0), 2, 1))
    hide_le92
    , SUM (REPLACE (NVL (s.HIDE_LE94, 0) + NVL (p.HIDE_LE94, 0), 2, 1))
    hide_le94
    , SUM (REPLACE (NVL (s.HIDE_LE96, 0) + NVL (p.HIDE_LE96, 0), 2, 1))
    hide_le96
    , COUNT (*) cnt
    FROM KRAMP_HPM_MAIN."StructureRevision" sr
    , KRAMP_HPM_MAIN."StructureGroupRevision" sgr
    , KRAMP_HPM_MASTER."ArticleStructureMap" asm
    , KRAMP_HPM_MASTER."ArticleRevision" ar_p
    , KRAMP_HPM_MASTER."ArticleDetail" ad_p
    , KRAMP_HPM_MASTER."ArticleRevision" ar_i
    , KRAMP_HPM_MASTER."ArticleDetail" ad_i
    , KRAMP_HPM_MASTER."ArticleReference" ar
    , KRT_STRUCTURE_INFO s
    , KRT_PRODUCT_INFO p
    WHERE sr."StructureID" = sgr."StructureID"
    AND sgr."StructureGroupID" = asm."StructureGroupID"
    AND ar_p."ID" = asm."ArticleRevisionID"
    AND ar_p."ID" = ad_p."ArticleRevisionID"
    AND ad_p."Res_Text100_02" = 'PRODUCT'
    AND ar_i."ID" = ad_i."ArticleRevisionID"
    AND ad_i."Res_Text100_02" = 'ARTICLE'
    AND ar."ArticleRevisionID" = ar_p."ID"
    AND ar."ReferencedSupplierAID" = ar_i."Identifier"
    AND s.STRUCTURE_GRP_REV_ID = sgr."ID"
    AND p.PIM_ARTICLEREVISIONID = ar_p."ID"
    GROUP BY sr."Identifier", ar_i."Identifier";Any ideas are welcome..
    Thanks
    FJFranken

    Hemant K Chitale wrote:
    These two tables are in the PIM_KRG schema while the other tables in the query are distributed across two other schemas "KRAMP_HPM_MAIN" and "KRAMP_HPM_MASTER" ?
    Do you happen to have the same table names occurring in multiple schemas - the query is then referencing the data in the wrong schema ?
    Hemant K ChitaleHi,
    This is not the case. The KRAMP_HPM schema's are application dedicated schema's
    And this also then does not explain why the results are correct after generating statistics.
    Anyway thanks for the tip.
    FJFranken

  • Invalid number error when calculating with sysdate

    Hello - I am getting invalid number error for query below:
    SELECT *
    FROM
    trkg
    WHERE
    trkg.tran_type=500
    AND
    trkg.mod_date_time>sysdate-0.5
    I am not sure what is wrong with above query. Strange part is that it executes fine in one environmnet and returns 'invalid number' error in other environmnet? Please help me find missing setting.

    more information:
    Table1: LOCN_HDR with field locn_brcd and locn_id
    locn_brcd locn_id
    26001A 0000086
    26002A 0000087
    26001B 0000088
    Table2: PICK_LOCN with field LOCN_ID
    locn_id
    0000086
    0000087
    0000088
    Table3: TRKG with field from_locn and mod_date_time (this is timestamp field)
    from_locn mod_date_Time
    0000086 29-MAY-13 10.09.23.000000000 AM
    0000087 29-MAY-13 10.11.48.000000000 AM
    0000088 31-MAY-13 04.07.21.000000000 PM
    Now I combine Table1 and Table3
    select * from appwms.locn_hdr lh
    join
    (SELECT lh.locn_brcd,trkg.mod_Date_Time from appwms.trkg
    join appwms.locn_hdr lh
    on trkg.FROM_LOCN = lh.LOCN_ID
    where
    trkg.TRAN_TYPE = 500
    and trkg.mod_Date_time>sysdate-5
    ) trkg1 on lh.locn_brcd=trkg1.locn_brcd
    -- returns values correctly
    Now when I join another table to above (ie table 2), it returns 'invalid number'
    select * from appwms.locn_hdr lh
    join
    (SELECT lh.locn_brcd,trkg.mod_Date_Time from appwms.trkg
    join appwms.locn_hdr lh
    on trkg.FROM_LOCN = lh.LOCN_ID
    where
    trkg.TRAN_TYPE = 500
    and trkg.mod_Date_time>sysdate-5
    ) trkg1 on lh.locn_brcd=trkg1.locn_brcd
    join
    (select pld.locn_id,lh.locn_brcd
    from APPWMS.PICK_LOCN PLD join appwms.locn_hdr lh
    on pld.locn_id = lh.LOCN_ID ) picklocn on picklocn.locn_brcd=lh.locn_brcd
    why are rows returned with one join? when i have more than one join why does it return error 'invalid number'.

  • To_number function and the "invalid number" error

    Dear all,
    I have searched the forum for threads relating to the ORA-01722: invalid number error, could not find the answer I am looking for.
    What I was trying to do was
    select * from table1 where to_number(field1) > 1000
    field1 is a varchar2 data type.
    I tried all sorts of things i.e using fmt, nls params as defined in the documentation, nothing worked.
    Though the practical problem was solved by
    select * from table1 where field1 > '1000'
    I would still like to know why this error occurs. Can someone help ?
    Regards
    Crusoe

    I think the database engine should simply return the rows that successfully convert to number and meet the where condition Oracle does not work in that way ;)
    Then try this...
    Just you need to add the below where clause to your source query. as this will retrieve only the number, to_number should work without any problem.
    But still you have to create a subquery to escape the invalid number error.
    PRAZY@11gR1> select * from tablea;
    FIELD1
    123
    123.345
    45
    AVC
    23.234.234
    ABC.234
    345.45
    7 rows selected.
    Elapsed: 00:00:00.00
    PRAZY@11gR1> select to_number(field1) from tablea where  rtrim(trim(regexp_replace(field1,'\.','',1,1)),'0123456789') is null;
    TO_NUMBER(FIELD1)
                  123
              123.345
                   45
               345.45
    4 rows selected.
    Elapsed: 00:00:00.01Regards,
    Prazy
    Edited by: Prazy on Mar 23, 2010 4:00 PM

  • 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

  • TO_NUMBER and ORA-01722 invalid number pls delete

    I cannot see where to delete a post I made. I found out my problem. It was in my NLS settings. Decimals were set to be commas instead of periods.
    please disregard this post, and delete if you are a moderator
    I recently tried to bring in lat/long coordinates from a VARCHAR2 field (and even as a flat file) into a NUMBER field with a setup of NUMBER(20,13) to ensure I'd capture all of the signifigant digits.
    I even ran this through a procedure to check if the data is a number first, and update only. I've found however that I keep getting the ORA-01722 invalid number error.
    So I started testing out some points, and came across this:
    select to_number('-79.662965387') from dual;
    this query results in the invalid number error. I don't want to have to load these as an SDO GEOMETRY object, has anyone encountered this scenario before?
    Or is my choice of 13 decimal places too high for Oracle?

    I just ran that code in my database (10g) and it returned this
    select to_number('-79.662965387') from dual;
    TO_NUMBER('-79.662965387')
                    -79.662965
    1 row selected.Message was edited by:
    Tridith

  • Understanding NVL: INVALID NUMBER in NVL Function

    Hi,
    The below query is a part of a cursor which takes in p_po_number as input with datatype same as segment1 of po_headers_all (varchar2(20)). The columns event_system_id1 to event_system_id4 are varchar2(240). In most cases p_po_number will be null as the program is scheduled and the input parameter of p_po_number is not passed. In effect, for most cases, the below query will end like event_system_id1 = NVL(NULL,event_system_id1)
    I am getting an error of INVALID NUMBER
    SELECT TO_NUMBER (event_system_id1)
    FROM c_fnd_intf_transact_q
    WHERE event_system_id2 = :p_organization_code
    AND event_system_id4 =
    DECODE (:p_po_type,
    :vgc_internal, 'XXX',
    :vgc_standard
    AND event_system_id1 =
    NVL (p_po_number, event_system_id1)
    I modified the query to
    SELECT event_system_id1
    FROM c_fnd_intf_transact_q
    WHERE event_system_id2 = :p_organization_code
    AND event_system_id4 =
    DECODE (:p_po_type,
    :vgc_internal, 'XXX',
    :vgc_standard
    AND event_system_id1 =
    NVL (p_po_number, event_system_id1)
    which still threw the same error thus ruling out the cause of the issue being that to_number leaving only the implicit conversions of NVL.
    I further modified the query to
    SELECT TO_NUMBER (event_system_id1)
    FROM c_fnd_intf_transact_q
    WHERE event_system_id2 = :p_organization_code
    AND event_system_id4 =
    DECODE (:p_po_type,
    :vgc_internal, 'XXX',
    :vgc_standard
    AND p_po_number is not null
    which gave me the desired result in a round about way.
    What confuses me here is both p_po_number and event_system_id1 are of varchar2 type. Why am I getting the error of INVALID NUMBER here and why is NVL converting the second parameter NUMBER datatype when the first one is VARCHAR2 even though null.
    I am working in Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production.
    P.S: The column event_system_id1 is not restricted to store numbers alone. It also contains character values though I use it only for storing number as it is shared table.

    Well, the expression
    NVL (p_po_number, event_system_id1)
    has NUMBER and VARCHAR2 elements, and you say "+P.S: The column event_system_id1 is not restricted to store numbers alone+" , and the documentation:
    http://download.oracle.com/docs/cd/E14072_01/server.112/e10592/functions117.htm
    says:
    +The arguments expr1 and expr2 can have any data type. If their data types are different, then Oracle Database implicitly converts one to the other. If they are cannot be converted implicitly, the database returns an error. The implicit conversion is implemented as follows:+
    +•If expr1 is character data, then Oracle Database converts expr2 to the data type of expr1 before comparing them and returns VARCHAR2 in the character set of expr1.+
    +•If expr1 is numeric, then Oracle determines which argument has the highest numeric precedence, implicitly converts the other argument to that data type, and returns that data type.+
    Exactly what is it you don't understand?
    Regards, A

  • TO_NUMBER getting invalid number error

    I want to use TO_NUMBER function to converse some float number,
    but the following query always gets invalid number error:
    select to_number('12.1073') from dual;
    but if I add the format in, it runs as expected:
    select to_number('12.1073', '99.9999') from dual;
    From the syntax, the format parameter is optional, is it only optional for integers?
    Thanks!

    Same here.
    So, or you replace dot by comma, or you change the territory (or nls_numeric_characters) defined for your session :
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='america';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='france';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_numeric_characters='.,';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> Nicolas.

  • Problem with a simple function that return a number

    Hi,
    I'm writing a function that return a number. I receive always an error (invalid number) but I don't understand why.
    The function is this:
    >
    FUNCTION COUNT_OBJECT(workflow_name_p IN NUMBER, object_type_p IN VARCHAR2) RETURN NUMBER
    IS
    object_inserted NUMBER;
    BEGIN
    object_inserted := 0;
    IF workflow_name_p = 'AIMDailyIngestorWorkflow'
    THEN
    object_inserted := 1;
    else
    object_inserted := 100;
    END IF;
    RETURN object_inserted;
    END COUNT_OBJECT;
    I have left only an if and an assignment because I do not find the error.
    When I execute the function I receive always this error:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:
    There are not operation, only assignment I cannot understand.
    Could someone help me?
    Thanks bye bye.

    I changed in this way:
    FUNCTION COUNT_OBJECT(workflow_name_p IN VARCHAR2, object_type_p IN VARCHAR2) RETURN NUMBER
    IS
    object_present NUMBER;
    object_inserted NUMBER;
    table_name_p VARCHAR2(4000);
    query_stmt VARCHAR2(4000);
    BEGIN
    IF workflow_name_p = 'AIMDailyIngestorWorkflow'
    THEN
    SELECT SUM(B.STOREDOBJS) INTO object_present
    FROM DPCTJOBTYPESTATS B
    WHERE B.WORKFLOW_NAME = workflow_name_p AND B.OBJTYPE=object_type_p;
    SELECT 'AIM.'||B.TABLE_NAME INTO table_name_p
    FROM DPCTSWOBJTYPE B
    WHERE B.OBJTYPE=object_type_p AND SOFTWARE='AIM';
    EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || table_name_p || ';' INTO object_inserted;
    object_inserted := object_inserted - object_present;
    END IF;
    RETURN object_inserted;
    END COUNT_OBJECT;and now the error is:
    ORA-00911: invalid character
    ORA-06512: at "INFRA.WORKFLOW_STATISTICS", line 504
    00911. 00000 - "invalid character"
    *Cause:    identifiers may not start with any ASCII character other than
    letters and numbers. $#_ are also allowed after the first
    character. Identifiers enclosed by doublequotes may contain
    any character other than a doublequote. Alternative quotes
    (q'#...#') cannot use spaces, tabs, or carriage returns as
    delimiters. For all other contexts, consult the SQL Language
    Reference Manual.
    but the line 504 is the blank line higlighted with the ***.
    Why this error? The code seems correct.
    Thanks, bye bye.

  • The Query returns a JBO Sql Exeptions of Invalid number

    Here is the query which returns the Invalid number exception on a R12 environment -
    SELECT feb.entity_id,
    rel.parent_entity_id,
    fetl.entity_name,
    pfetl.entity_name parent_entity_name,
    ccytl.currency_code,
    ccytl.name AS currency_name,
    fettl.entity_type_name,
    fettl.entity_type_code,
    rel.cons_relationship_id,
    decode( fettl.entity_type_code,
    'E', to_number(''),
    decode( operassoc.parent_entity_id,
    to_number(''), rel.ownership_percent,
    to_number(''))) ownership_percent,
    ttl.treatment_name,
    cttl.curr_treatment_name,
    decode( fettl.entity_type_code,
    'O', 'Y',
    'X', 'Y',
    decode( rel.cons_relationship_id,
    '', 'Y',
    'N')) AS details_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'O', decode(feb.entity_id,
    operassoc.child_entity_id, 'N',
    'Y'),
    'Y') AS add_entity_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'C', decode( rel.cons_relationship_id,
    '', 'N',
    'Y'),
    decode( operassoc.parent_entity_id,
    '', 'Y',
    'N')) AS move_remove_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'C', decode( rel.cons_relationship_id,
    '', decode( childassoc.child_entity_id,
    '', 'N',
    'Y'),
    'Y'),
    decode( operassoc.parent_entity_id,
    '', 'Y',
    'N')) AS create_update_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'C', decode( rel.cons_relationship_id,
    '', 'N',
    'Y'),
    decode( operassoc.parent_entity_id,
    '', 'Y',
    'N')) AS update_update_icon_displayed,
    imageattr.entity_image,
    decode(imageattr.entity_image, '', 'N', 'Y') entity_image_displayed,
    rel.end_date,
    decode(rel.cons_relationship_id, :0, 'Y', 'N') blue_dot_displayed,
    decode(operassoc.parent_entity_id, '', 'Ownership', 'ParentText') ownership_switcher
    FROM FEM_ENTITIES_B feb,
    FEM_ENTITIES_TL fetl,
    FEM_ENTITIES_TL pfetl,
    GCS_ENTITY_CONS_ATTRS eca,
    FND_CURRENCIES_TL ccytl,
    FEM_ENTITIES_ATTR fetea,
    FEM_DIM_ATTRIBUTES_B fetda,
    FEM_DIM_ATTR_VERSIONS_B fet_dav,
    FEM_ENTITY_TYPES_TL fettl,
    GCS_CONS_RELATIONSHIPS rel,
    GCS_TREATMENTS_TL ttl,
    GCS_CURR_TREATMENTS_TL cttl,
    (SELECT operea.entity_id AS parent_entity_id,
    operea.dim_attribute_numeric_member AS child_entity_id
    FROM FEM_ENTITIES_ATTR operea,
    FEM_DIM_ATTRIBUTES_B operda,
    FEM_DIM_ATTR_VERSIONS_B oper_dav
    WHERE operda.attribute_varchar_label = 'OPERATING_ENTITY'
    AND operda.attribute_id = operea.attribute_id
    AND oper_dav.attribute_id = operda.attribute_id
    AND oper_dav.default_version_flag = 'Y'
    AND oper_dav.version_id = operea.version_id) operassoc,
    (SELECT operea.entity_id AS parent_entity_id,
    operea.dim_attribute_numeric_member AS child_entity_id
    FROM FEM_ENTITIES_ATTR operea,
    FEM_DIM_ATTRIBUTES_B operda,
    FEM_DIM_ATTR_VERSIONS_B oper_dav
    WHERE operda.attribute_varchar_label = 'OPERATING_ENTITY'
    AND operda.attribute_id = operea.attribute_id
    AND oper_dav.attribute_id = operda.attribute_id
    AND oper_dav.default_version_flag = 'Y'
    AND oper_dav.version_id = operea.version_id) childassoc,
    (SELECT imageea.entity_id,
    imageea.varchar_assign_value AS entity_image
    FROM FEM_ENTITIES_ATTR imageea,
    FEM_DIM_ATTRIBUTES_B imageda,
    FEM_DIM_ATTR_VERSIONS_B image_dav
    WHERE imageda.attribute_varchar_label = 'IMAGE_NAME'
    AND imageda.attribute_id = imageea.attribute_id
    AND image_dav.attribute_id = imageda.attribute_id
    AND image_dav.default_version_flag = 'Y'
    AND image_dav.version_id = imageea.version_id) imageattr
    WHERE feb.entity_id = fetl.entity_id
    AND fetl.language = userenv('LANG')
    AND eca.entity_id (+)= feb.entity_id
    AND eca.hierarchy_id (+)= :1
    AND ccytl.currency_code (+)= eca.currency_code
    AND ccytl.language (+)= userenv('LANG')
    AND fetea.entity_id = feb.entity_id
    AND fetea.attribute_id = fetda.attribute_id
    AND fetda.attribute_varchar_label = 'ENTITY_TYPE_CODE'
    AND fet_dav.attribute_id = fetda.attribute_id
    AND fet_dav.default_version_flag = 'Y'
    AND fet_dav.version_id = fetea.version_id
    AND fettl.entity_type_code = fetea.dim_attribute_varchar_member
    AND fettl.language = userenv('LANG')
    AND rel.child_entity_id (+)= feb.entity_id
    AND rel.hierarchy_id (+)= :2
    AND rel.actual_ownership_flag (+)= 'Y'
    AND pfetl.entity_id (+)= rel.parent_entity_id
    AND pfetl.language (+)= userenv('LANG')
    AND ttl.treatment_id (+)= rel.treatment_id
    AND ttl.language (+)= userenv('LANG')
    AND cttl.curr_treatment_id (+)= rel.curr_treatment_id
    AND cttl.language (+)= userenv('LANG')
    AND operassoc.child_entity_id (+)= rel.child_entity_id
    AND operassoc.parent_entity_id (+)= rel.parent_entity_id
    AND childassoc.parent_entity_id (+)= feb.entity_id
    AND imageattr.entity_id (+)= feb.entity_id
    AND (rel.start_date IS NULL OR rel.start_date <= nvl(:3, rel.start_date))
    AND (rel.end_date IS NULL OR rel.end_date >= nvl(:4, rel.end_date))
    ORDER BY decode( operassoc.parent_entity_id,
    '', decode( entity_type_code,
    'O', 2,
    'C', 3,
    'E', 4,
    999),
    1),
    entity_name
    Same query returns correct results in 11i environment.
    This query fails at the executeQueryForCollection method.
    Any ideas why?
    Thanks - Alpi
    Edited by: user581082 on Sep 17, 2009 1:16 AM

    Here is the full Error Stack -
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT     feb.entity_id,
         rel.parent_entity_id,
         fetl.entity_name,
         pfetl.entity_name parent_entity_name,
         ccytl.currency_code,
         ccytl.name AS currency_name,
         fettl.entity_type_name,
         fettl.entity_type_code,
         rel.cons_relationship_id,
         decode(     fettl.entity_type_code,
              'E', to_number(''),
              decode(     operassoc.parent_entity_id,
                   to_number(''), rel.ownership_percent,
                   to_number(''))) ownership_percent,
         ttl.treatment_name,
         cttl.curr_treatment_name,
         decode(     fettl.entity_type_code,
              'O', 'Y',
              'X', 'Y',
              decode(     rel.cons_relationship_id,
                   '', 'Y',
                   'N')) AS details_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'O', decode(feb.entity_id,
    operassoc.child_entity_id, 'N',
    'Y'),
              'Y') AS add_entity_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'C', decode(     rel.cons_relationship_id,
                        '', 'N',
                        'Y'),
              decode(     operassoc.parent_entity_id,
                   '', 'Y',
                   'N')) AS move_remove_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'C', decode(     rel.cons_relationship_id,
                        '', decode(     childassoc.child_entity_id,
                                  '', 'N',
                                  'Y'),
                        'Y'),
              decode(     operassoc.parent_entity_id,
                   '', 'Y',
                   'N')) AS create_update_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'C', decode(     rel.cons_relationship_id,
                        '', 'N',
                        'Y'),
              decode(     operassoc.parent_entity_id,
                   '', 'Y',
                   'N')) AS update_update_icon_displayed,
         imageattr.entity_image,
         decode(imageattr.entity_image, '', 'N', 'Y') entity_image_displayed,
         rel.end_date,
         decode(rel.cons_relationship_id, :0, 'Y', 'N') blue_dot_displayed,
         decode(operassoc.parent_entity_id, '', 'Ownership', 'ParentText') ownership_switcher
    FROM     FEM_ENTITIES_B feb,
         FEM_ENTITIES_TL fetl,
         FEM_ENTITIES_TL pfetl,
         GCS_ENTITY_CONS_ATTRS eca,
         FND_CURRENCIES_TL ccytl,
         FEM_ENTITIES_ATTR fetea,
         FEM_DIM_ATTRIBUTES_B fetda,
         FEM_DIM_ATTR_VERSIONS_B fet_dav,
         FEM_ENTITY_TYPES_TL fettl,
         GCS_CONS_RELATIONSHIPS rel,
         GCS_TREATMENTS_TL ttl,
         GCS_CURR_TREATMENTS_TL cttl,
         (SELECT     operea.entity_id AS parent_entity_id,
              operea.dim_attribute_numeric_member AS child_entity_id
         FROM     FEM_ENTITIES_ATTR operea,
              FEM_DIM_ATTRIBUTES_B operda,
              FEM_DIM_ATTR_VERSIONS_B oper_dav
         WHERE     operda.attribute_varchar_label = 'OPERATING_ENTITY'
         AND     operda.attribute_id = operea.attribute_id
         AND     oper_dav.attribute_id = operda.attribute_id
         AND     oper_dav.default_version_flag = 'Y'
         AND     oper_dav.version_id = operea.version_id) operassoc,
         (SELECT     operea.entity_id AS parent_entity_id,
              operea.dim_attribute_numeric_member AS child_entity_id
         FROM     FEM_ENTITIES_ATTR operea,
              FEM_DIM_ATTRIBUTES_B operda,
              FEM_DIM_ATTR_VERSIONS_B oper_dav
         WHERE     operda.attribute_varchar_label = 'OPERATING_ENTITY'
         AND     operda.attribute_id = operea.attribute_id
         AND     oper_dav.attribute_id = operda.attribute_id
         AND     oper_dav.default_version_flag = 'Y'
         AND     oper_dav.version_id = operea.version_id) childassoc,
         (SELECT     imageea.entity_id,
              imageea.varchar_assign_value AS entity_image
         FROM     FEM_ENTITIES_ATTR imageea,
              FEM_DIM_ATTRIBUTES_B imageda,
              FEM_DIM_ATTR_VERSIONS_B image_dav
         WHERE     imageda.attribute_varchar_label = 'IMAGE_NAME'
         AND     imageda.attribute_id = imageea.attribute_id
         AND     image_dav.attribute_id = imageda.attribute_id
         AND     image_dav.default_version_flag = 'Y'
         AND     image_dav.version_id = imageea.version_id) imageattr
    WHERE     feb.entity_id = fetl.entity_id
    AND     fetl.language = userenv('LANG')
    AND     eca.entity_id (+)= feb.entity_id
    AND     eca.hierarchy_id (+)= :1
    AND     ccytl.currency_code (+)= eca.currency_code
    AND     ccytl.language (+)= userenv('LANG')
    AND     fetea.entity_id = feb.entity_id
    AND     fetea.attribute_id = fetda.attribute_id
    AND     fetda.attribute_varchar_label = 'ENTITY_TYPE_CODE'
    AND     fet_dav.attribute_id = fetda.attribute_id
    AND     fet_dav.default_version_flag = 'Y'
    AND     fet_dav.version_id = fetea.version_id
    AND     fettl.entity_type_code = fetea.dim_attribute_varchar_member
    AND     fettl.language = userenv('LANG')
    AND     rel.child_entity_id (+)= feb.entity_id
    AND     rel.hierarchy_id (+)= :2
    AND rel.actual_ownership_flag (+)= 'Y'
    AND     pfetl.entity_id (+)= rel.parent_entity_id
    AND     pfetl.language (+)= userenv('LANG')
    AND     ttl.treatment_id (+)= rel.treatment_id
    AND     ttl.language (+)= userenv('LANG')
    AND     cttl.curr_treatment_id (+)= rel.curr_treatment_id
    AND     cttl.language (+)= userenv('LANG')
    AND     operassoc.child_entity_id (+)= rel.child_entity_id
    AND     operassoc.parent_entity_id (+)= rel.parent_entity_id
    AND     childassoc.parent_entity_id (+)= feb.entity_id
    AND     imageattr.entity_id (+)= feb.entity_id
    AND     (rel.start_date IS NULL OR rel.start_date <= nvl(:3, rel.start_date))
    AND     (rel.end_date IS NULL OR rel.end_date >= nvl(:4, rel.end_date))
    ORDER BY     decode(     operassoc.parent_entity_id,
                   '', decode(     entity_type_code,
                             'O', 2,
                             'C', 3,
                             'E', 4,
                             999),
                   1),
              entity_name) QRSLT WHERE PARENT_ENTITY_ID = :6
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:896)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2845)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:797)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01722: invalid number
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1062)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:857)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4511)
         at oracle.apps.gcs.setup.hierarchy.server.EntitiesVOImpl.executeQueryForCollection(EntitiesVOImpl.java:106)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.activateRowSetState(ViewRowSetImpl.java:4925)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3792)
         at oracle.jbo.server.ViewRowSetImpl.activateIteratorState(ViewRowSetImpl.java:4960)
         at oracle.jbo.server.OAJboViewObjectImpl.activateInternalRowSets(Unknown Source)
         at oracle.jbo.server.OAJboApplicationModuleImpl.activateState(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateState(OAApplicationModuleImpl.java:3066)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:7053)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6961)
         at oracle.jbo.server.Serializer.activate(Serializer.java:274)
         at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330)
         at oracle.jbo.server.ApplicationModuleImpl.activateFromStack(ApplicationModuleImpl.java:5768)
         at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5628)
         at oracle.jbo.server.ApplicationModuleImpl.activateStateForUndo(ApplicationModuleImpl.java:7697)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateStateForUndo(OAApplicationModuleImpl.java:2159)
         at oracle.apps.gcs.setup.hierarchy.server.HierarchyAMImpl.activateStateForUndo(HierarchyAMImpl.java:10364)
         at oracle.apps.gcs.setup.hierarchy.webui.HierUploadCO.processFormRequest(HierUploadCO.java:89)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2841)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:797)
    java.sql.SQLException: ORA-01722: invalid number
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1062)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:857)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4511)
         at oracle.apps.gcs.setup.hierarchy.server.EntitiesVOImpl.executeQueryForCollection(EntitiesVOImpl.java:106)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.activateRowSetState(ViewRowSetImpl.java:4925)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3792)
         at oracle.jbo.server.ViewRowSetImpl.activateIteratorState(ViewRowSetImpl.java:4960)
         at oracle.jbo.server.OAJboViewObjectImpl.activateInternalRowSets(Unknown Source)
         at oracle.jbo.server.OAJboApplicationModuleImpl.activateState(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateState(OAApplicationModuleImpl.java:3066)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:7053)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6961)
         at oracle.jbo.server.Serializer.activate(Serializer.java:274)
         at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330)
         at oracle.jbo.server.ApplicationModuleImpl.activateFromStack(ApplicationModuleImpl.java:5768)
         at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5628)
         at oracle.jbo.server.ApplicationModuleImpl.activateStateForUndo(ApplicationModuleImpl.java:7697)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateStateForUndo(OAApplicationModuleImpl.java:2159)
         at oracle.apps.gcs.setup.hierarchy.server.HierarchyAMImpl.activateStateForUndo(HierarchyAMImpl.java:10364)
         at oracle.apps.gcs.setup.hierarchy.webui.HierUploadCO.processFormRequest(HierUploadCO.java:89)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2841)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:797)

  • I have one contact that I can call but cannot text. A return text states it is an invalid number. How can I fix it?

    I have one contact that I can call but cannot text. A return text states it is an invalid number. I have erased and re-entered the contact, changed phone identification and tried resetting the network - none have worked. What else can I try?

    What kind of phone is this person using? If this is an iPhone, are you logged into iMessage. If this is not an iMessage, then I suggest you both contact AT&T. SMS which is what is used between non-iPhone devices or between an iPhone and non-iPhone device are a carrier function. There is no setting in iOS or on the iPhone that deals with SMS. If you are able to send iMessage and/or SMS to other people, then AT&T needs to either look into your account to ensure SMS is configured, or they need to look at this other person's phone to see what it is reporting as its number since it is coming back invalid for you.

  • IS THERE A FUNCTION TO RETURN THE NUMBER OF MONTHS OR DAYS?

    I know that you can do a months between function between 2 dates divided by 12 and get years but is there a function that can return the number of months between 2 dates or the number of days between 2 dates in a select statement for a report? These 2 dates are entered in an Oracle forms.
    I have 2 dates.
    BEG_SVC_DT 30-JUL-1995 DATE FORMAT
    END_SVC_DT 981007 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I add 31 to 07 and get 38. I subtract 30 from 38 and get 8.
    or I have 2 dates
    BEG_SVC_DT 10-JAN-2003 DATE FORMAT
    END_SVC_DT 050924 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I subtract 10 from 24 and get 14.
    In both scenarios the end_dt field must be VARCHAR2 because the user has to enter the word 'PRESENT' . Is there a function in SQL that would compute the
    number of days between 2 dates?
    Is there a function to get the number of months between 2 dates?
    I have 2 dates.
    BEG_SVC_DT 12-JUL-2004 DATE FORMAT
    END_SVC_DT 050807 VARCHAR2 FORMAT Positions 3 and 4 are months.
    I must subtract BEG_SVC_DT from END_SVC_DT
    JUL is the 7th month.
    In PLSQL, I subtract 07 from 08 and get 01
    Or I have 2 dates
    BEG_SVC_DT 13-NOV-2004 DATE FORMAT
    END_SVC_DT 050429 VARCHAR2 FORMAT Positions 3 and 4 are months.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    NOV is the eleventh month. 04 is less than 11.
    In PLSQL I have to add 12 to 04 and subtract 11 from 16 to get 05.
    In both scenarios, the end_dt field must be VARCHAR2 because the user has to enter the word 'PRESENT'. In SQL, is there a function to compute the number of months between 2 dates?
    I am doing my calculations this way because this is the way that the user has been doing them when they created the report manually.
    The database that I am using is Oracle 9.2.0.6
    Report Writer Report Builder 6.0.8.22.0
    Forms 6.0.8.22.1

    In your example:
    BEG_SVC_DT 30-JUL-1995 DATE FORMAT
    END_SVC_DT 981007 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I add 31 to 07 and get 38. I subtract 30 from 38 and get 8.
    Where is the "31" depending on, on year and month of BEG_SVC_DT or END_SVC_DT?
    What would be the answer for the following example
    BEG_SVC_DT 25-FEB-1995 DATE FORMAT
    END_SVC_DT 980407 VARCHAR2 FORMAT
    Do I add 28 (=number of days in FEB-1995),
    or 30 (=number of days in APR-1998),
    or 31 (= max number of days in any month?)

Maybe you are looking for

  • Iphoto 9.1 won't open after install of ilife'11

    I recently installed ilife'11 to my macbook - iphoto installed and then kept unexpectedly quit. I upgraded to iphoto 9.1 but now it iphoto says it is not compatible. Help!

  • Two users on same computer how to use the same program and data

    Two users on one computer how to share a program and it's data

  • Apps not showing in purchases.

    So about 3 or so weeks ago I redeemed a $10 iTunes gift card. I obtained the code from FreeMyApps. I was in the Australian store so I switched my store to the U.S store. I then redeemed the gift card code and $10 credit was added to my account. Then

  • Only focus on items in JTable wich are editable

    Hi, I have a jtable with custom renderers and sometimes editors. When I tab through the table I only want it to tab from editable field to editable field thus skip the normal fields. Does anyone know how to do this? Thanks is advance, Hugo

  • Fund Management-Configuration guide step by step

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. > Dear Sap gurus, Please send Fund management configuration guide step by step. I