ORA-01722 errors

Hi guys, I am stuck with this error for a csv table I tried to upload by sql loader
This is the error I am getting:
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table DSLAMPVP_SUMMARY, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
DSLAM_CLLI FIRST * , O(") CHARACTER
PATH_NAME NEXT * , O(") CHARACTER
ATM_HOPS NEXT * , O(") CHARACTER
PATH_LENGTH NEXT * , O(") CHARACTER
TRANSPORT_HOPS NEXT * , O(") CHARACTER
FIBRE_LATENCY NEXT * , O(") CHARACTER
ATM_LATENCY NEXT * , O(") CHARACTER
TRANSPORT_LATENCY NEXT * , O(") CHARACTER
LATENCY NEXT * , O(") CHARACTER
Record 1: Rejected - Error on table DSLAMPVP_SUMMARY, column ATM_HOPS.
ORA-01722: invalid number
Record 2: Rejected - Error on table DSLAMPVP_SUMMARY, column LATENCY.
ORA-01722: invalid number
However, the property for ATM_HOPS and beyond should be number, NOT charaters... according to the table structure on the server. Can anyone tell me why sql loader is recognize them as character instead of number? My source file also have these column in numbers (their actual property in Excel is "general") Please advise, and thank you all in advance.

load data
append
into table dslampvp_summary
fields terminated by "," optionally enclosed by '"'
DSLAM_CLLI,
Path_Name,
ATM_Hops     EXTERNAL DECIMAL,
Path_Length     EXTERNAL DECIMAL,
Transport_Hops     EXTERNAL DECIMAL,
Fibre_Latency     EXTERNAL DECIMAL,
ATM_Latency     EXTERNAL DECIMAL,
Transport_Latency     EXTERNAL DECIMAL,
Latency     EXTERNAL DECIMAL )
Many thanks,
Edited by: thinkman on Sep 9, 2009 11:38 AM

Similar Messages

  • Pipelined function with Union clause(Invalid Number(ORA-01722) error )

    Hi,
    I have a pipelined function.
    I am fetching the data with the use of a REF cursor.
    The query has two part: query1 and query2
    when I am opeing the cursor with query1 UNION query2,it is giving me Invalid Number(ORA-01722) error.
    but when I open the cursor separately for query1 and query2,I am getting the resultset for each of the query.
    query1 and query2 are running fine with UNION in the sql editor.
    But,when I put them into two variables (var1 :='query1' and var2:='query2' and try to open the cursor with var1 UNION var2 , it's giving me the error.
    But when I put query2 as 'Select ..... from dual' and then try to open the cursor for query1 UNION query2,
    then getting the result of query1 and one extra row for query2(dual).
    The FROM table set is same for query1 and query2..
    can anyone please help me , why this Invalid Number(ORA-01722) error is coming.

    query1 := 'SELECT to_char(st.store_no) STORE_NUMBER,pp.name PROGRAM_NAME, ''HBS'' DISPENSING_SYSTEM,
    pt.PATIENT_SRC_NO SOURCE_ID, null RX2000_PATIENT_IDENTIFIER, pt.last_name PATIENT_LAST_NAME, pt.first_name
    PATIENT_FIRST_NAME, to_char(LPAD (pppd.rx_number, 7, '' '')|| ''-''|| LPAD (pppd.refill_number, 2, 0)) RX_REFILL
    FROM
    pega_patient_program_dispense pppd,pega_patient_program_reg pppr,health_care_profs hcp1,
    health_care_profs hcp2,prescription_dispenses pd,prescriptions p, pega_program_status_reason ppsr ,master_doctors md,
    prescription_disp_orders pdo, hbs_shipment_extract hse,stores st,master_stores ms,pega_programs pp,patients pt,master_patients mpt
    WHERE
    pppr.referring_hcp_id=md.id(+) and md.dispensing_system_id=hcp1.hcp_id and
    pppr.ID=pppd.PEGA_PATIENT_PROGRAM_REG_ID and pppd.prescription_dispense_id=pd.id and pd.prescriptions_id=p.id and
    p.hcp_id=hcp2.hcp_id and ppsr.ID=pppd.PEGA_PROGRAM_STATUS_REASON_ID and pppd.prescription_dispense_id = pdo.prescriptions_dispenses_id(+) AND
    pdo.shipment_number = hse.shp_no(+) and pppd.store_id=ms.id and st.id=ms.dispensing_system_id and pppr.pega_program_id=pp.id
    and pppr.patient_id=mpt.id and pt.patient_id=mpt.dispensing_system_id and pppd.dispensing_system=''HBS'' and pp.name LIKE ''REV%''
    AND
    ((pppd.prescription_dispense_id IS NOT NULL AND pppd.quantity_dispensed > 0 AND pppd.reported_date IS NULL AND
    pppd.src_delete_date IS NULL AND ((pppr.program_specific_patient_code IS NULL ) OR (hcp1.last_name IS NULL) OR
    (hcp1.first_name IS NULL) OR (hcp2.first_name IS NULL) OR (hcp2.last_name IS NULL) OR (hcp2.address_1 IS NULL) OR
    (hcp2.city IS NULL) OR (hcp2.state_cd IS NULL) OR (hcp2.zip_1 IS NULL)OR (pppr.referral_date is NULL) OR
    (hcp1.state_cd IS NULL) OR (hcp1.zip_1 IS NULL)
    OR (hcp2.zip_1 IS NULL) OR (pppr.last_status_change_date IS NULL) OR (pppr.varchar_1 IS NULL) OR
    (pppr.varchar_7 IS NULL OR pppr.varchar_7 LIKE ''NOT AVAILABLE AT REFERRAL%'') OR (pppr.varchar_5 IS NULL OR
    pppr.varchar_5 LIKE ''NOT AVAILABLE AT REFERRAL%'')) ) AND ppsr.INCLUDE_ON_EXCEPTION_RPT_IND=''Y'')
    OR
    ((pppd.authorization_number IS NULL OR NVL(TRUNC(pdo.shipped_date),TRUNC(hse.shp_act_date_dt)) NOT BETWEEN
    TRUNC(pppd.date_1) AND TRUNC(pppd.date_2)) OR (pppd.varchar_4 IS NULL OR NVL(TRUNC(pdo.shipped_date),
    TRUNC(hse.shp_act_date_dt)) NOT BETWEEN TRUNC(pppd.date_3) AND TRUNC(pppd.date_5)))
    OR
    (pppr.pega_program_competitors_id IS NULL AND (ppsr.manufacturer_status=''TRIAGE'' AND ppsr.manufacturer_reason=''COMPETITOR''))
    OR
    (ppsr.manufacturer_reason IS NULL)
    query2 := ' SELECT ''150'' STORE_NUMBER,''test'' PROGRAM_NAME , ''RX2000'' DISPENSING_SYSTEM
    ,''01'' SOURCE_ID, null RX2000_PATIENT_IDENTIFIER, ''test'' PATIENT_LAST_NAME, ''test'' PATIENT_FIRST_NAME,
    ''rx01'' RX_REFILL
    FROM
    pega_patient_program_reg pppr,health_care_profs hcp1, pega_program_status_reason ppsr ,
    master_doctors md,stores st,master_stores ms,pega_programs pp,patients pt,master_patients mpt
    WHERE
    pppr.referring_hcp_id=md.id(+) and md.dispensing_system_id=hcp1.hcp_id and
    ppsr.ID=pppr.REFERRAL_STATUS_ID and st.store_type=''M'' and pppr.store_id=ms.id and st.id=ms.dispensing_system_id
    and pppr.pega_program_id=pp.id and pppr.patient_id=mpt.id and pt.patient_id=mpt.dispensing_system_id and pp.name LIKE ''REV%''
    AND
    ((((pppr.program_specific_patient_code IS NULL ) OR (hcp1.last_name IS NULL) OR (hcp1.first_name IS NULL) OR
    (pppr.referral_date is NULL) OR (hcp1.state_cd IS NULL) OR (hcp1.zip_1 IS NULL) OR (pppr.last_status_change_date IS NULL)
    OR (pppr.varchar_1 IS NULL) OR (pppr.varchar_7 IS NULL) OR (pppr.varchar_5 IS NULL OR pppr.varchar_5 LIKE
    ''NOT AVAILABLE AT REFERRAL%'')) ) AND ppsr.INCLUDE_ON_EXCEPTION_RPT_IND=''Y'')
    OR
    (pppr.pega_program_competitors_id IS NULL AND (ppsr.manufacturer_status=''TRIAGE'' AND ppsr.manufacturer_reason=''COMPETITOR''))
    OR
    (ppsr.manufacturer_reason IS NULL)
    AND
    pppr.id NOT IN(select pppd.PEGA_PATIENT_PROGRAM_REG_ID from PEGA_PATIENT_PROGRAM_DISPENSE pppd)';
    BUT IF I put
    query2 := ' SELECT ''150'' STORE_NUMBER,''test'' PROGRAM_NAME , ''RX2000'' DISPENSING_SYSTEM
    ,''01'' SOURCE_ID, null RX2000_PATIENT_IDENTIFIER, ''test'' PATIENT_LAST_NAME, ''test'' PATIENT_FIRST_NAME,
    ''rx01'' RX_REFILL
    FROM DUAL';
    then it is giving result.

  • ORA-01722: Error while executing query in Query Designer

    Hi All;
    I am getting the below error while executing a query
    ORA-01722: invalid number
    Error reading the data of InfoProvider
    Error while reading data; navigation is possible
    Have anyone encountered this before? How do i resolve this?
    Thanks!
    ~ Arun KK

    Hi,
    Did you checked all the setting required to run this query are present in the Qualtiy system??
    Which means all the characteristics,key figures are in active state.
    Also all the cubes are in active state with no issues with the involved in the dimensions used for the query.
    Also do a check in the query and if you have authorization try to save the same query and execute the saved one again in quality and see if the same error happens again.
    Thanks
    Ajeet

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

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

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

  • ORA-01722 Error

    Hi,
    I'm creating a search page with 4 fields. 3 of the fields come directly from the database so those pose no problem. The last field is a custom field (say month number) which indirectly searchs a field in the DB. I'd like to pull out all records that contain a given month number - the field in the database would contain the full date.
    In the view object, I've added a transient field to contain my custom field (called SearchMonth). In the query, I have added this:
    ... to_number(extract(MONTH FROM BilledSplitInfoRptHdr.CYCLE_DATE)) = to_number(:1)
    In the view controller, I've bound my variable ${binding.SearchMonth}.
    When I execute, I get an error ORA-01722 which states that the number was an invalid number...
    I'm not sure if I"m binding incorrectly, or the custom search field is being found but crashing in the conversion? Any help is appreciated.
    Thanks.

    Jason,
    Some debugging should help here. For starters you could go to the Project Properties => Runner, and in the Java Options field fill in:
    -Djbo.debugoutput=console
    In the (large amount) of additional logging you should be able to identify the value for the bind parameter.
    Of course you could also try a simple breakpoint on the get/setSearchMonth and run the application using 'debug' instead of 'run'.
    Hope this helps,
    Peter Ebell
    JHeadstart Team

  • ORA-01722 Error while drill down

    Hi all,
    I have one EUL created with the join of two difference views. In order to join this two view, two id is needed to be joined. I have create a item class whereby it has been joins for this two views. Eg. I got view A with id1 & id2 link to view B with id1 & id2 as well. If I drill down from id1 or id2 column, the screen able to open up the new sheet which will show me the details information that I want.
    However, if try to drill down from item code then, the scren has prompted me the above error. What's wrong with this code ?
    Rgds
    Lim

    Hi,
    Check this note:
    794661
    or try searching OSS with that error.
    Hope this helps.
    Regards,
    Diego

  • 'ORA-01722: Invalid Number' error while Running a Query

    Hi,
    I'm trying to run a query built on a DSO. The DSO has a field 'Start Date'. This Start Date InfoObject has a reference Char as 0DATE.
    This Start Field has blank values due to which I'm getting the ORA-01722 error. I came across many threads with same topic of discussion. As mentioned in one of the Threads I have written a program to update 'Start Date' with 00000000. The code wriiten is "UPDATE /BIC/AZ_MONINV00 SET /BIC/ZSTR_DTE = '00000000' where /BIC/ZSTR_DTE = ' '.
    Now when I see the data in the active data table of DSO the blank value is replaced with '00000000'.
    But If I right click on the DSO click on display data the 'Start Date' field is blank. And now the Query also gets executed without any error. But in the output of the query the 'Start Date' Field has "#" values.
    Can anyone suggest on how can I make these "#" values appear as 00000000 in the report?

    In this case, you have to write a macro to avoid # in Analyzer.
    Right Click-->Display Data will show data from Active table of DSO only.
    If you don't want to show any blank date values in the report, you can exclude in Filter in Query.

  • ORA-01722: invalid number Error in lpad

    I get an ORA-01722 error on the following update statement when field1 contains a non-numeric character. The field is defined as CHAR(4). 99.99% of the time field1 will contain spaces and/or numeric data.
    set field1 = lpad(to_char(to_number(field1)),4,'0')
    where (substr (field1, 1, 1) = ' ' or
    substr (field1, 4, 1) = ' ')
    If I remove the to_number portion of the lpad statement I still get the ORA-01722 error. (This baffles me, to be honest.)
    If I remove both the to_char and the to_number so that I just have the lpad statement, the field is not being padded with zeros, as per the following code example.
    set field1 = lpad(field1,4,'0')
    where (substr (field1, 1, 1) = ' ' or
    substr (field1, 4, 1) = ' ')
    First, I don't understand why the stand-alone lpad statement will not pad field1 with zeros.
    Second, since the stand-along lpad isn't padding the fields, what can I do to make the set statement work to avoid the ORA-01722 error when non-numeric characters are present?
    Thank you.

    To take your points more or less in order.
    The TRIM function came in 8 something. It works in my 8.1.7.4 instance, but I don't have anything earlier to test with. You can use LTRIM(RTRIM(field1)) (substitute where appropriate below) instead. That should work even on your 7.3.
    When I said "all 4 characters", I really meant had no spaces in them e.g. 'A123' not 'A12 '. Doing LPAD(TRIM('A12 ')) would return '0A12' which is probably not what you would want.
    My approach to the fields with alpha characters would really depend on how critical this field is to business operations, and whether you could automate a fix for it. You could identify them using something like:
    FUNCTION isnumber(p_totest IN VARCHAR2) RETURN NUMBER IS
       l_tmp NUMBER;
    BEGIN
       l_tmp := TO_NUMBER(TRIM(p_totest));
       RETURN 1;
    EXCEPTION
       WHEN OTHERS THEN
          RETURN 0;
    END;
    SELECT * FROM t
    WHERE IsNumber(field1) = 0what you do with that depends.
    Avi's solution needs a minor re-work. The TO_CHAR function adds an extra space to the character representation of the number to hold a sign. You could use something more like:
    UPDATE t
    SET field1 = TO_CHAR(TO_NUMBER(field1),'FM0009')The FM format mask stops TO_CHAR from adding the extra character. As long as all the numbers are positive this would be fine. However, it will still throw 1722 on all spaces or an alpha character.
    It is not that LPAD cannot handle all spaces, it is the TRIM that screws up all spaces. By trimming all spaces you get NULL, and NULL LPADed to any length is NULL. Because the column is defined as CHAR(4), all records, except explicit NULLs, will be right padded with spaces to that length, so in order to LPAD with zeroes, you need to trim off the extra spaces.
    If I understand your basic requirement, you want to get field1 set to a four digit number, left padded with zeroes, or all zeroes if it is null or spaces. I would likely do this in a single step using the IsNumber function above. Something like:
    UPDATE t
    SET field1 = NVL(LPAD(TRIM(field1),4,'0'),'0000')
    WHERE IsNumber(field1) = 1If getting '0A12' in field 1 is acceptable after the update, then you don't really need the IsNumber at all.
    HTH
    John

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

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

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

  • ORA 01722 & NFE.....SOS!

    im constantly getting 2 errors on console (Solaris XManager)
    **java.sql.SQLException: ORA-01722: invalid number**
    **java.lang.NumberFormatException: For input string: "abc"**
    In my bean file theres a method calld 'FLoc()' in which
    im passing 5 parameteres (all strings) plus sessionID.
    in that method a method is called which is in another file
    called 'gsms()': there are SAME six parameters; all Strings
    also in that method, JDBC connectivity is done with
    procedure calls.
    That procedure contains 11 'IN' parameters & 2 'OUT'
    p pi_session_id                    IN      1          VARCHAR2,
                                  2          pi_B_p_M                    IN                VARCHAR2,
                                  3          pi_log_id                    IN                NUMBER,
                                  4          pi_B_p_loc                    IN                VARCHAR2,
                                  5          pi_ms_st                    IN                VARCHAR2,
                                  6          pi_s_re_time                    IN               VARCHAR,
                                  7          pi_s_re_flag                    IN               VARCHAR2,
                                  8          pi_s_re_text                    IN                VARCHAR2,
                                  9          pi_ap_st_id                    IN               NUMBER,
                                  10          pi_t_app                    IN               DATE,
                                  11          pi_s_er                    IN               VARCHAR2,
                                            po_err_code                    OUT               NUMBER,
                                            po_B_party_locn_details          OUT          Pkg_Refcur.ref_type)
    help needed !! SOS!!! this silly problem has been bugging me since a day!!! im not very comfortable with JDBC/Core Java concepts...
    i searched ORA error...it said some conversion problem.
    i couldnt understand please explain.

    Thanks dcminter for that. .....
    Got rid of that NumberFormatException but ORA 01722 error is still bugging me :)
    straight from the console ::
    at src.SInterface.dbstorage.gSM(dbstorage.java:212)
    at src.FLoc.FLocJBean.fLoc(FLocJBeanjava:146)
    at org.apache.jsp.src.FLoc.SLoc_jsp._jspService(SLoc_jsp.java:93)
    where could be the error???

  • ORA-01722 when executing a procedure

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

    ORA-01722: invalid number
    Cause: The attempted conversion of a character string to a number failed because the character string was not a valid numeric literal. Only numeric fields or character fields containing numeric data may be used in arithmetic functions or expressions. Only numeric fields may be added to or subtracted from dates.
    Action: Check the character strings in the function or expression. Check that they contain only numbers, a sign, a decimal point, and the character "E" or "e" and retry the operation.
    Maybe you have bad data?

  • URGENT - ORA-01722 Causing Chaos!

    A few days ago, our test server suddenly took a dislike to numeric-to-character comparisons e.g.
    SELECT whatever
    FROM my_table
    WHERE my_char_column = 1;
    This type of code is commonplace as we have a lookup table for decoding codes which, by its nature is entirely VARCHAR2 to encompass all data types that may be stored therein.
    Somewhere on Google it suggested...
    "Oracle will automatically convert a string to a number when a number-to-character comparison is made UNLESS there is an index on the string's column."
    Indeed, an index was missing. This was restored and code like that above started to work again (as it had for years previously!).
    However, today on our live server the same ORA-01722 errors suddenly started to occur (affecting most transactions). The software (Oracle Forms) has not changed and all indexes are intact. The longstanding code is similar to that above with the additional use of a TO_NUMBER function.
    In SQL*Plus the following code logic works on our copy of the database as it was yesterday:
    SELECT whatever
    FROM my_table
    WHERE TO_NUMBER(my_char_column) = 1
    AND my_other_char_column = 'SOMETHING';
    It doesn't work against today's database. The numerous parts of the system reporting the error are unchanged as far as the actual code is concerned.
    The DBA people are confused (understandably) as they cannot recall doing anything of note to the database or the affected table.
    Any suggestions would be greatly appreciated on what could have caused this behavioural cnange in Oracle.
    Professor Yaffle

    Many thanks - an interesting read.
    Our DB is 8.1.7.4. It does all seem to point towards Oracle's optimisation - does this change its behaviour on the fly? I'll ask DBA explicitly whether CBO/RBO has been toggled (but surely they'd have mentioned that already). I know they tinkered with it a couple of years back with detrimental effect...
    There are non-numeric values in my lookup table, due to its nature, but the conditions of the SQL statements have thus far suppressed the error.
    I'd love to change all our code to live happily with the optimisation rules (i.e. compare like with like) but that will take time (months probably!) & all I'd like to acheive is to get the database behaving as it did yesterday.
    NEWSFLASH: DBA suggests "someone analysed the table". Hmmm. Methinks the problem will soon strangely go away once affected table's optimisation method is restored to that of yesterday!
    Grrr...

  • SQL Query and Exception ORA-01722

    Hi,
    I have a table called t_lookup which has three columns Lookup_Value, Description and Lookup_Type all of them are varchar2 type. If I execute the below query, its working fine
    SELECT *
    FROM (SELECT Lookup_Value
    *,To_Number(Description) Dd*
    FROM t_Lookup
    WHERE Lookup_Type = 'CALENDAR') Tab ;
    Here is the result
    Lookup_Value .............. Dd
    January....................... 1
    February..................... 2
    March......................... 3
    April........................... 4
    May........................... 5
    June.......................... 6
    July........................... 7
    August....................... 8
    September................... 9
    October...................... 10
    November................... 11
    December................... 12
    But when i execute
    SELECT *
    FROM (SELECT Lookup_Value
    *,To_Number(Description) Dd*
    FROM t_Lookup
    WHERE Lookup_Type = 'CALENDAR') Tab
    AND Dd = 9;
    then it is throwing ORA exception
    ORA-01722: invalid number
    Can any one help me on this in order to understand the root cause of this problem? Oracle server I am using is "Oracle9i Release 9.2.0.8.0" .
    Thanks

    I'm assuming that it is intended that certain descriptions will have non-numeric data in them, right?
    Assuming that is the case, the success or failure of the query will depend on how the optimizer happens to choose to execute your query. If it happens to run the TO_NUMBER function before it filters out a row with non-numeric data, you'll get an error. If it happens to run the TO_NUMBER after filtering out all the rows with non-numeric data, the query will be successful. Given that query plans are subject to change, particularly when you eventually upgrade, you probably don't want to just find a SQL query that works, you'll need to ensure that either the query plan never changes or that the query is formulated in such a way that it will never fail.
    My first thought would be whether you really need to store numeric data in a VARCHAR2 field in the first place. I'm guessing this is some sort of generic lookup table (which cause a raft of issues, this being one). Can you at least store string, date, and number data in separate columns?
    Barring that, can you create your own PL/SQL function that converts a string to a number and catches the exception?
    CREATE OR REPLACE FUNCTION my_to_number( p_arg IN varchar2 )
      RETURN NUMBER
    IS
      l_num NUMBER;
    BEGIN
      l_num := to_number( p_arg );
      RETURN l_num;
    EXCEPTION
      WHEN others THEN
        RETURN NULL;
    END;That will ensure that the query will be successful regardless of the plan. Note that you would probably want to catch just the ORA-01722 error, not OTHERS, in your real code-- this is just a sample.
    Barring that, you'll need to do something to enforce stability in the query plan. A stored outline that forces this query to use the query plan that doesn't generate an error.
    Justin

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

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

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

  • Error Message - ORA-01722 Invalid Number

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

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

Maybe you are looking for

  • Can not view my photos in iPhoto. All photos are black

    I have an iPad 3 and I can not view my photos. I can view them through the photo stream on my phone but on my iPad they come up black. I'm not sure what to do.

  • Getting 'File not found' error while using server object model code

    Hi, I am using server object model code to pull list data in a console application. My machine has standalone installation of SP 2010. I am getting error 'File Not Found', however the same operation is working fine with client object model code. Code

  • Photoshop Elements 4 & 5 and Windows Vista

    I'm thinking about getting a new laptop. All of them come with VISTA at this time. Will I be able to run PSE 4 on a VISTA laptop? Will PSE 5 run on VISTA? Lloyd Erickson

  • Synced ical with mobileme, now can't edit calendar

    Hi, I synced ical through mobileme thinking mobileme would serve as a "backup" for my ical. I use ical on my macbook and don't check the mobileme calendar. but now i can't write on my ical when it is open on my macbook. how can i change the settings

  • How to create HFM extended analysis's dsn

    I have configure my DSN info in HFM server, but I still can't see any dsn in the HFM extend analysis. So...is there any other step to create HFM extended analysis's dsn? Thank you