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

Similar Messages

  • Case When Statement and ORA:01722 Invalid number error

    Hi folks, I have posted this under another heading as well under E-business suite so apologies if some you have already seen it but I would really appreciate some help on this one. Any suggestions are most welcome.
    We are trying to put together a calculation that returns the number of days absent an individual has had in a given time period. We need to cater for those absences that started before the period and are closed during it, absence that start during the period and end after it, and those that open and close within it.
    The period is always a rolling 6 months from sysdate.
    This is the calc we have come up with so far which works for some people but we get the invalid number error if the absence includes a half day - so 0.5, 1.5,etc.
    This is probably over complicated but we are not techie at all so are learning as we go!
    We are using the HRMS - Administration - Oracle Human Resources (Core) business area in 10G and the Absence Attendance and Person folders.
    SUM(TO_NUMBER(NVL(( CASE WHEN Absence Attendance.Actual Start Date < TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') THEN ( CASE WHEN Absence Attendance."Actual End Date" > SYSDATE THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) END ) END ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( Absence Attendance.Duration Days ) END ) END ) END ) END ) END ),( DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") )),'999999990D00'))

    Hi,
    It could be that this is because you are using SYSDATE which contains the time as a fraction rather than TRUNC(SYSDATE) which just contains the current time. It could be that your working_dates_between raises this error.
    However, your formula is far more complicated than it needs to be.
    Firstly, you want to look at the date window ADD_MONTHS(TRUNC(SYSDATE), -6) to TRUNC(SYSDATE). Then you want to look at the portion of the absence that falls in the date window. This is GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6)) to LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE)). You may need to add 1 to the absence end date because this is the last day of their absence rather than the date they return. It depends how you calculate the days between the start and end
    date of the absence. You can create calculations for the start and end date of the absences within the 6 months time window. Create calculation AbsenceStart as
    GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6))
    and AbsenceEnd as
    LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE))
    Then you need to only pick up absence that a part of the absence in your 6 month date window. You can use a condition in the workbook or a condition in a case statement to do this. You then need to calculate the difference between these dates and SUM all the values.
    SUM(CASE WHEN AbsenceEnd >= AbsenceStart THEN WORKING_DAYS_BETWEEN(AbsenceStart, AbsenceEnd) END)
    That's it. Not so complicated after all.
    Rod West

  • Case When Statement and ORA:1722 Invalid number error

    Sorry I posted this in the wrong forum - I have the answer now
    Cheers
    HELP!!!
    We are trying to put together a calculation that returns the number of days absent an individual has had in a given time period. We need to cater for those absences that started before the period and are closed during it, absence that start during the period and end after it, and those that open and close within it.
    The period is always a rolling 6 months from sysdate.
    This is the calc we have come up with so far which works for some people but we get the invalid number error if the absence includes a half day - so 0.5, 1.5,etc.
    This is probably over complicated but we are not Techie at all so are learning as we go! We are using the HRMS - Administration - Oracle Human Resources (Core) business area in 10G and the Absence Attendance and Person folders.
    SUM(TO_NUMBER(NVL(( CASE WHEN Absence Attendance.Actual Start Date < TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') THEN ( CASE WHEN Absence Attendance."Actual End Date" > SYSDATE THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) END ) END ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( Absence Attendance.Duration Days ) END ) END ) END ) END ) END ),( DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") )),'999999990D00'))
    Edited by: CPearce on Sep 25, 2008 8:03 AM

    Hi,
    It could be that this is because you are using SYSDATE which contains the time as a fraction rather than TRUNC(SYSDATE) which just contains the current time. It could be that your working_dates_between raises this error.
    However, your formula is far more complicated than it needs to be.
    Firstly, you want to look at the date window ADD_MONTHS(TRUNC(SYSDATE), -6) to TRUNC(SYSDATE). Then you want to look at the portion of the absence that falls in the date window. This is GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6)) to LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE)). You may need to add 1 to the absence end date because this is the last day of their absence rather than the date they return. It depends how you calculate the days between the start and end
    date of the absence. You can create calculations for the start and end date of the absences within the 6 months time window. Create calculation AbsenceStart as
    GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6))
    and AbsenceEnd as
    LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE))
    Then you need to only pick up absence that a part of the absence in your 6 month date window. You can use a condition in the workbook or a condition in a case statement to do this. You then need to calculate the difference between these dates and SUM all the values.
    SUM(CASE WHEN AbsenceEnd >= AbsenceStart THEN WORKING_DAYS_BETWEEN(AbsenceStart, AbsenceEnd) END)
    That's it. Not so complicated after all.
    Rod West

  • Invalid number error , number column as last field in my csv

    LOAD DATA
    INFILE 'test.csv' "str '#'"
    APPEND
    INTO TABLE esgapp.c_test
    FIELDS TERMINATED BY "," Optionally enclosed by '"'
    TRAILING NULLCOLS
    rstring,
    rtext char(12000) ENCLOSED BY '<start>' and '<end>',
    ruser,
    rid SEQUENCE(MAX,1)
    This control file is working good . But what i have done is i have altered my table *ruser* column which was earlier varchar now it is number . the data in the ruser is number , now i am getting an error while executing the the script
    it is throwing an invalid number error .
    i have tried this changes before i post this post in the control file but all are throwing the invalid number error
    ruser char "to_number(rtrim(ltrim(:ruser)))"
    and
    ruser decimal external
    csv file
    hello,<start>bla...bla...bla...bla,-996203
    error
    invalid number
    Edited by: user7955917 on Mar 5, 2012 9:34 AM
    Edited by: user7955917 on Mar 5, 2012 9:41 AM
    Edited by: user7955917 on Mar 5, 2012 9:42 AM

    But....If your Oracle version is 10g+, you can define the file as external table and use the "RECORDS DELIMITED BY '#'" parameter.
    :p

  • ORA-01722: invalid number error with Bulk collect

    Hi ,
    I have been using the script to delete old seasonal data from my application DB tables. The stored procedure has been created successfully but when i try to run the proc it has been throwing 'ORA-01722: invalid number' exception at line 'FETCH C1_CUR BULK COLLECT INTO C1_TYPE_VAR LIMIT v_bulklimit;'.
    Could you please help me here?
    Below is the stored proc:
    CREATE OR REPLACE PROCEDURE clean_old_season_data(P_SEASON VARCHAR2) AS
    CURSOR C1_CUR IS SELECT ROWID RID,pro.* FROM PROPS pro where pro.ITEMPK IN
    (SELECT sve.pk FROM SAVEDVALUEENTRY sve WHERE sve.p_parent IN
    (SELECT s.pk FROM SAVEDVALUES s WHERE s.P_MODIFIEDITEM IN
    (SELECT a.PK
    FROM products a
    WHERE a.p_season IN (select s.pk from Seasons s where s.P_code=P_SEASON)
    ) ) ) and rownum<5;
    CURSOR C2_DEL IS SELECT RID FROM PROPS_HISTORY;
    TYPE C1_TYPE IS TABLE OF C1_CUR%ROWTYPE;
    C1_TYPE_VAR C1_TYPE;
    TYPE C2_TYPE IS TABLE OF UROWID;
    C2_TYPE_VAR C2_TYPE;
    ex_dml_errors EXCEPTION;
    PRAGMA EXCEPTION_INIT(ex_dml_errors, -24381);
    l_error_count NUMBER;
    err_num NUMBER;
    err_msg VARCHAR2 (300);
    COMMIT_VARIABLE PLS_INTEGER:=0;
    v_bulklimit NUMBER:=2;
    BEGIN
    /*------------------ Data Selection and INSERTION IN HISTORY TABLE ---------------------------------------*/
    OPEN C1_CUR;
    LOOP
    DBMS_OUTPUT.put_line('Cursor opend now in loop');
    FETCH C1_CUR BULK COLLECT INTO C1_TYPE_VAR LIMIT v_bulklimit;//ERROR OCCURS HERE
    DBMS_OUTPUT.put_line('Cursor count is'|| C1_TYPE_VAR.COUNT);
    FORALL I IN 1..C1_TYPE_VAR.COUNT SAVE EXCEPTIONS
    INSERT INTO PROPS_HISTORY VALUES C1_TYPE_VAR(I);
    COMMIT_VARIABLE := COMMIT_VARIABLE + v_bulklimit;
    DBMS_OUTPUT.put_line('Commit variable'|| COMMIT_VARIABLE.COUNT);
    IF COMMIT_VARIABLE = v_bulklimit THEN
    COMMIT;
    COMMIT_VARIABLE := 0;
    END IF;
    EXIT WHEN C1_CUR%NOTFOUND;
    END LOOP;
    DBMS_OUTPUT.put_line('Cursor closed now in loop and data inserted in history table');
    CLOSE C1_CUR;
    /*------------------ Data Selection and DELETION IN Live TABLE ---------------------------------------*/
    COMMIT_VARIABLE := 0;
    OPEN C2_DEL;
    LOOP
    FETCH C2_DEL BULK COLLECT INTO C2_TYPE_VAR LIMIT 2;
    FORALL I IN 1..C2_TYPE_VAR.COUNT SAVE EXCEPTIONS
    DELETE FROM PROPS WHERE ROWID = C2_TYPE_VAR(I);
    COMMIT_VARIABLE := COMMIT_VARIABLE + 2;
    IF COMMIT_VARIABLE = 2 THEN
    COMMIT;
    COMMIT_VARIABLE := 0;
    END IF;
    EXIT WHEN C2_DEL%NOTFOUND;
    END LOOP;
    CLOSE C2_DEL;
    END;

    Although there are many things which should not have been done in the posted code, I could not find any reason why the Invalid number error should occur at the Fetch clause.
    I would suggest you to Insert into Table by providing the Order of Columns i.e. Insert into table (col1, ... colN) values (coll(i).col1...col(i).colN);
    I tested below code and it did not give any errors.
    drop table test_table;
    create table test_Table
      rid   varchar2(100),
      emp_id  number(5),
      fname   varchar2(20),
      lname   varchar2(50)
    set serveroutput on;
    declare
      cursor c_cur is
          select rowid rid, e.*
            from employees e
           where rownum < 10;
      type typ_cur is table of c_cur%rowtype;
      typ typ_cur;
      l_bulk_limit    number := 5;
    begin
      open c_cur;
      loop
        fetch c_cur bulk collect into typ limit l_bulk_limit;
        dbms_output.put_line('Collection Count :: ' || typ.count);
        forall i in 1..typ.count --typ.first..typ.last
          insert into test_Table (rid, emp_id, fname, lname) values (typ(i).rid,typ(i).employee_id,typ(i).first_name,typ(i).last_name);
        dbms_output.put_line('Processed ' || l_bulk_limit || ' records.');
        exit when c_cur%notfound;
      end loop;
      commit;
    end;
    select * from test_table;PS:- 1. When you are processing only 4 Records, then why are you breaking them in 2 Loops?
    2. Why Commit every time you are processing a DML? Why not maintain an Error Flag and Rollback the Transaction as soon as error is encountered?
    3. Use "{code}" (Exclude Double Quotes) to format the code. I am not sure if works.
    Regards,
    P.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Invalid Number Error in Merge Statement

    Hi all.
    I got an invalid number error in the following merge statement, but I don't know why. Maybe you can give me a hint.
    MERGE INTO wam_table
    USING (SELECT * FROM wam_table) b
    ON (b.username = 'user'
    AND b.mod = 'module'
    AND b.trimester = '1')
    WHEN MATCHED THEN
    UPDATE SET as = '1', ad = '1', co = '1', pr = '1', date = localtimestamp, lus = 'username'
    WHEN NOT MATCHED THEN
    INSERT VALUES ('user','module','1','1','1','1','1', localtimestamp, 'username');
    The invalid number error appears in the first line, but I don't know why?
    Stephan

    UPDATE SET as = '1', ad = '1', co = '1', pr = '1', date = localtimestamp, lus = 'username'SELECT * FROM sys.v_$reserved_words;
    SQL> create table test1(as varchar2(10));
    create table test1(as varchar2(10))
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1(sno number, date date);
    create table test1(sno number, date date)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1("as" varchar2(10));
    Table created.
    SQL>
    SQL> create table test2(sno number, "date" date);
    Table created.
    SQL> desc test1
    Name                                      Null?    Type
    as                                                 VARCHAR2(10)
    SQL> desc test2
    Name                                      Null?    Type
    SNO                                                NUMBER
    date                                               DATE
    SQL> 

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

  • Find the Column Name which gives Invalid Number Error

    Hi,
    There are about 150 columns in a table and data to this table is from a external source like flat file. when these data are loaded to the table for a particular column it gives Invalid Number Error. So need to find for Which Numeric Column a String Value is about to be inserted.
    since we are sure not whether the proper Values are coming from Source in Front End we pass the Value within ' quotes.
    So how do we get the Column for which the error is raised :-)

    If you are using SQL*Loader, the log will tell you which row and column has the error.
    Otherwise you may need to code your own debugging statements.

  • I would like to put Dreamweaver 8 on a new computer.  There is no "deactivate" function and the technical support person I chatted with recommended I come here.  Can I just use the serial number again?  How can I deactive?  Has anyone else run into this?

      There is no "deactivate" function and the technical support person I chatted with recommended I come here.  Can I just use the serial number again?  How can I deactive?  Has anyone else run into this?  How can I get Dreamweaver 8, which is no longer being activated by Adobe, on a new computer?  Is it even worth doing or do I need to get a new version.  What are the killer features I'm missing?

    If you manage to get it installed on your current OS, don't forget to install the 8.02 update.
    Adobe - Dreamweaver Support Center : Updaters
    Nancy O.

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

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

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

  • Another ORA-01722: invalid number Error

    Hello All,
    I have 2 Validations on 1 Item, Not Null and Not Exists, very standard.
    select fk_session_name_id
    from hrt_session
    where fk_session_name_id = :p9_fk_session_name_id
      and fk_class_id = :p9_fk_class_id;My Item needs to be a Select List that returns the ID of FK_SESSION_NAME_ID.
    select distinct SESSION_NAME display_value, PK_SESSION_NAME_ID return_value
    from HRT_SESSION_NAME
    order by 1My Form Page throws the ORA-01722 in invalid number Error only when I make the Item a Select List. If Item is a
    Text Field and ID value entered and Create is clicked the data is saved but not when its a Select List. I have read alot
    of threads that talk about converting this Item to_number but I have not been successful in doing this. Once the Item is
    a Select List the Not Exists validation works but the Not Null Validation populates the Error Message. Can anyone
    assist me with this please? Thanks
    My Data Type is INTEGER for FK_SESSION_NAME_ID and SESSION_NAME is VARCHAR2.
    SESSION_NAME data....
    SESSION 1
    SESSION 2
    PMAS 1
    PMAS 2
    BASIC WORD 2003.....
    Edited by: Charles A on Jan 11, 2010 1:42 PM

    Hey Jari,
    The PK_SESSION_NAME_ID in the select statement is the value that is going to be returned. FK_SESSION_NAME_ID is the Foreign Key value that will get the value from the Primary Key PK_SESSION_NAME_ID.
    Yes, I do have an account that you can log into, thanks for assistance Jari.
    Once you log in Select link 'Hrt_Class' which will populate Page 2. Region 'Cascading LOVs has 4 Items. Class Meridiem, Class Name, Class End Date and Class Location. Select these values then click 'Search'. Once the values are populated click the red button at the bottom 'Add Session Info'. This will populate Page 9 which will allow you to test the Create button. You should not be able to add any Session Name that exists in the Report below and you should not be able to Create a Null FK_SESSION_NAME_ID. Let me know if this is clear, thanks again.
    The PK_SESSION_ID cannot be Null so just start with values 60116 on up to avoid that error message. I do not have any sequences or triggers created since this is just a testing app.
    Edited by: Charles A on Jan 11, 2010 4:05 PM

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

  • Invalid Number Error in IR search bar.

    Hi,
    I am getting an invalid number error when i put a value in search bar without selecting the column name.
    I followed ' "Invalid number" error using Interactive Report search on collection' thread and accordingly
    1) Purged User preferences and session state.
    2) Cleared browser settings and cache.
    3) Deleted old region and Created a new region on the page with the same query.
    If I select a column and search it works fine but when I just give an arrangement id which looks like 'ARR12345' directly in search bar it throws Invalid Number.
    This is working perfectly fine in other environments which is replica of this one.
    I also ran Apex util function to remove sort preferences.
    Also my report is a very simple report like select * from a,b where a.id = b.id.
    Please help me. This is a production issue.
    Thanks a lot in advance.
    Regards
    Garima
    Edited by: 860249 on Nov 4, 2011 11:40 AM

    UPDATE SET as = '1', ad = '1', co = '1', pr = '1', date = localtimestamp, lus = 'username'SELECT * FROM sys.v_$reserved_words;
    SQL> create table test1(as varchar2(10));
    create table test1(as varchar2(10))
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1(sno number, date date);
    create table test1(sno number, date date)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1("as" varchar2(10));
    Table created.
    SQL>
    SQL> create table test2(sno number, "date" date);
    Table created.
    SQL> desc test1
    Name                                      Null?    Type
    as                                                 VARCHAR2(10)
    SQL> desc test2
    Name                                      Null?    Type
    SNO                                                NUMBER
    date                                               DATE
    SQL> 

Maybe you are looking for

  • How to tell which items are in iTunes library on disc but not in program library?

    I made a mistake the other night and I deleted some items from my iTunes library ... but NOT from disc. These items are still in my 65 gig iTunes library on disc.  Somewhere. I'd like to re-add these songs.  Is there any way to tell which songs in th

  • Book - map font keeps resetting

    I have a book that I started in iPhoto '09 and I should have finished it there. Working with fonts has become super annoying. I'm using the Travel theme, and on one of my map pages the fonts won't stay put. I set them the way I need, go to another pa

  • Finding a word within a string

    Hey everyone, Just having a little trouble with something. I'm trying to find a word -- that is, not a substring, an actual word as defined by the english language -- within a string. For example I don't want "hell" to be found in "hello".. only "hel

  • NOT WORKING -How To Display All Comments for a Planning Package

    Hi All, I am using How to Document "How To Display All Comments for a Planning Package" to display comments for list of "cost center" against different "fiscal/year" for Key Figure "Budget Amount". Below is how the Layout looks like where comments ar

  • At what point in a track to itunes previews play

    I am getting my music up onto iTunes and wanted to know at what number of seconds does the track preview play i.e. 0, 5, 10, 15 etc. Also how long does the preview play for? and finally, though I dont exect this to be possible - CD baby allows artist