Invalid number in 11g

Hi,
I have the code:
select n.cod
                        from numere_apel n
                         where n.stare = 'L'
                         and n.cod_prefix = '0254'
                        and LENGTH(TRIM(TRANSLATE(n.cod, ' +-.0123456789', ' '))) is null -- the condition to be numeric (n.cod can contain values that are not numeric)
                          and to_number(n.cod) > to_number('268980')this gives me invalid number at the last line (at the first to_number). However this WORKS in 9i without error, so in 11g what could be the cause?
I'm sure that the records from n.cod are just numbers (in 9i there are 3 records returned and they are NUMBERS.
It's very strange that in 9i works..
Thanks
Edited by: Roger22 on 26.08.2011 09:27
Edited by: Roger22 on 26.08.2011 09:27

Roger22 wrote:
but my condition is:
and to_number(n.cod) > to_number('435545')
and to_number(n.cod) < to_number('435549')+decode(10, 10, 10, 100, 100, 1000,1000)
..how should these 2 conditions be changed in 11 to work?
it's weird that does not work... strange
ThanksAs michaels has told you, Oracle is free to evaluate the predicates in the where clause in the order it deems most efficient.
Your query
and LENGTH(TRIM(TRANSLATE(n.cod, ' +-.0123456789', ' '))) is null -- the condition to be numeric (n.cod can contain values that are not numeric)
and to_number(n.cod) > to_number('268980')is an application bug. You got lucky in previous versions as the predicate
and LENGTH(TRIM(TRANSLATE(n.cod, ' +-.0123456789', ' '))) is null -- the condition to be numeric (n.cod can contain values that are not numeric)Was being applied before
and to_number(n.cod) > to_number('268980')As i say though, this is a bug in YOUR sql, not in Oracle. What you would / should have coded is
select <columns>
from
   select <columns>
   from numere_apel n
   where n.stare = 'L'
   and n.cod_prefix = '0254'
   and LENGTH(TRIM(TRANSLATE(n.cod, ' +-.0123456789', ' '))) is null -- the condition to be numeric (n.cod can contain values that are not numeric)
where to_number(n.cod) > to_number('268980')to ensure all the non-numeric data you need to TO_NUMBER was removed before you attempted to TO_NUMBER it.

Similar Messages

  • ORA-01722: invalid number - Error during implicit conversion (10g vls 11g)

    I am facing oracle error for few SELECT queries in 11g which were working fine in 10g environment.
    Oracle Version:
    10g - 10.2.0.5.0
    11g - 11.2.0.3.0
    We are storing numeric values under CHAR or VARCHAR2 column in few tables. This is known design issue & it can't be changed for now.
    I know this will work fine until all the data is numeric in those columns for respective table. Because by some reason, if any row got character value for that column then implicit string to number conversion will fail and this error can occur. But I have verified that there is no data issue.
    But I can see difference in the execution plan! But not able to recognize the reason issue.
    Any other pointers on why the queries are failing in 11g would be of great help..
    Example SQL:
    Note that table structure and data is same in both the environments.
    View Definition -
    CREATE OR REPLACE FORCE VIEW CIMSOS.LC_LOCATIONS
    (   COUNTRY_ID,    PRODUCTID,
       LANGUAGE_ID,   LOCATION_NAME,
       LOCATION_SHORT_NAME,   TAG_ID,   LOCATION_DEFINITION,
       COMPOSITEKEY,   GLOBAL_LOCATION_KEY,
       CPRODUCTKEYID,   CMODVERSION)
    AS
       SELECT
              CCOUNTRY_ID AS COUNTRY_ID,
              CPRODUCTID AS PRODUCTID,
              CLANGUAGE_CODE AS LANGUAGE_ID,
              CLOCATION_NAME AS LOCATION_NAME,
              CLOCATION_SHORT_NAME AS LOCATION_SHORT_NAME,
              CTAG_ID AS TAG_ID,
              CLOCATION_DEFINITION AS LOCATION_DEFINITION,
              CCOMPOSITEKEY AS COMPOSITEKEY,
              CGLOBAL_LOCATION_KEY0 AS GLOBAL_LOCATION_KEY,
              cproductkeyid,
              cmodversion
         FROM mct_35193, goldencopy
        WHERE     cproductkeyid = productkey
              AND cmodversion = version
              AND catalogid = 35193;Facing issue for SQL query based on above view:
    ** In 10g Env
    SELECT * FROM LC_LOCATIONS WHERE productid = 75;
    -- It executes successfully and provide required results.
    Explain Plan:
    SELECT STATEMENT  ALL_ROWSCost: 12  Bytes: 416  Cardinality: 4                 
         4 NESTED LOOPS  Cost: 12  Bytes: 416  Cardinality: 4            
              1 INDEX RANGE SCAN INDEX CIMSOS.GOLDENCOPY_INDX1 Cost: 10  Bytes: 30,225  Cardinality: 2,015       
              3 TABLE ACCESS BY INDEX ROWID TABLE CIMSOS.MCT_35193 Cost: 1  Bytes: 89  Cardinality: 1       
                   2 INDEX UNIQUE SCAN INDEX (UNIQUE) CIMSOS.XPK_MCT_34342 Cost: 0  Cardinality: 1  ** In 11g Env
    SELECT * FROM LC_LOCATIONS WHERE productid = 75;
    ORA-01722: invalid number
    Explain Plan:
    SELECT STATEMENT  ALL_ROWSCost: 40  Bytes: 8,692  Cardinality: 82            
         3 NESTED LOOPS  Cost: 40  Bytes: 8,692  Cardinality: 82       
              1 TABLE ACCESS FULL TABLE CIMSOS.MCT_35193 Cost: 22  Bytes: 819  Cardinality: 9 
              2 INDEX RANGE SCAN INDEX CIMSOS.GOLDENCOPY_INDX1 Cost: 2  Bytes: 135  Cardinality: 9 
    -- Executes when value is passed as character.
    SELECT * FROM LC_LOCATIONS WHERE productid = '75';

    The problem doesn't appear to be related to the Oracle version, at least not directly. If your query plan does the string to number conversion before eliminating the rows that have non-numeric data, you'll get an error. If the query plan eliminates the rows that have non-numeric data before doing the conversion, the query will succeed. It is entirely possible that you'd get the "bad" plan in 10g or the "good" plan in 11g.
    You can capture the query plans from your 10g database and move them over to the 11g database. Oracle has a nice white paper on upgrading from 10g to 11g that walks you through that process.
    Of course, you really don't want to be dependent on the optimizer picking the "right" plan, you really want to fix the underlying data model issue.
    Justin

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

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

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

  • Ora-01722 invalid number error in oracle 11g working fine in 9i

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

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

  • ORA-01722: invalid number while using TO_CHAR function.

    Hi All,
    I was using this query from around past 1 year and everything was working fine.
    select to_char ( '2012/12/23','YYYY/MM/DD') from dual;
    how ever from monday onwards , this is returning me with the following error.
    ORA-01722: invalid number
    The NLS_DATE_FORMAT is DD-MON-RR in my oracle 11g version.
    Please help me regarding this.

    Your date is in literal & your intended format so no need to format it again.
    select to_char ( '2012/12/23','YYYY/MM/DD') from dual;
    same as
    select '2012/12/23' from dual;I don't know your need so same code to work!!!
    select to_char(to_date('2012/12/23','YYYY/MM/DD'),'DD/MM/YYYY') from dualsunnymoon wrote:
    where vale for ? is coming as '2011/12/23' from java.
    the whole application has to be changed and retested.
    >
    It it comes as a text convert it to date TO_DATE('2011/12/23','YYYY/MM/DD') to use in comparison operators like =, != , > , < etc. Comparison operators used taking date as literal will give you wrong result.
    Better to do it right even it takes huge effort.
    Edited by: Lokanath Giri on ३ जनवरी, २०१२ १२:०६ अपराह्न

  • Invalid number error when using case when

    I have table called NATIONAL_RARE_ECOSYSTEMS which has 1 column called TEST_COLUMN (data type: varchar2):
    TEST_COLUMN
    rare ecosystem
    rare
    0
    0
    (null)
    (null)
    what I want is a query which will add a column called NRE_SCORE which will give each row instance a score of 0 if it null.
    If it is 0 then score should be 0.
    If the row contains any text then score should be 1
    I have written the query:
    SELECT
    (CASE WHEN test_column is null THEN 0
    WHEN test_column = 0 THEN 0
    WHEN test_column > 0 THEN 1
    END) AS NRE_SCORE
    FROM NATIONAL_RARE_ECOSYSTEMS;
    I get the error message:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    I think this is because on the 2nd and 3rd line I'm trying to do arithmetic on a column which is varchar2 which I know I cant do.
    How do I write a query which says: if the row contains text then give score of 1?
    I'm using oracle 11g.

    Hi,
    993451 wrote:
    I have table called NATIONAL_RARE_ECOSYSTEMS which has 1 column called TEST_COLUMN (data type: varchar2):
    TEST_COLUMN
    rare ecosystem
    rare
    0
    0
    (null)
    (null)
    what I want is a query which will add a column called NRE_SCORE which will give each row instance a score of 0 if it null.
    If it is 0 then score should be 0.
    If the row contains any text then score should be 1Any text other than '0', you mean. I assume it doesn't matter if that text happens to be all digits, such as '9876', or something with no digits, such as 'rare'.
    I have written the query:
    SELECT
    (CASE WHEN test_column is null THEN 0
    WHEN test_column = 0 THEN 0
    WHEN test_column > 0 THEN 1
    END) AS NRE_SCORE
    FROM NATIONAL_RARE_ECOSYSTEMS;
    I get the error message:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    I think this is because on the 2nd and 3rd line I'm trying to do arithmetic on a column which is varchar2 which I know I cant do.You're actually not doing any arithmetic, but you are comparing your VARCHAR2 column to a NUMBER, so it tries to convert the string to a NUMBER, and that's why you get the ORA-01722 error.
    >
    How do I write a query which says: if the row contains text then give score of 1?
    I'm using oracle 11g.Here's one way:
    SELECT       CASE
               WHEN  NVL (test_column, '0') = '0'
               THEN  0
               ELSE  1
           END          AS nre_score
    ,       ...          -- you must want other columns, too
    FROM       national_rare_ecosystems
    ;Since you don't really care about the numeric value, don't use NUMBERs anywhere; stick with VARCHAR2s, such as '0'.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the query above is getting the wrong results, and explain, using specific examples, how you get those results from the sample data in those palces.
    See the forum FAQ {message:id=9360002}

  • 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

  • Error ORA-01722: invalid number

    Hi,
    I am using Apex 3.2 on Oracle 11g (Enterprise Edition).
    I am new to Apex and I am using an imported application and editing its features to match my requirements.
    While uploading a CSV file, I am getting error as :ORA-01722: invalid number"
    Can someone help me where I am wrong or where I need to modify something?
    Thanks in advance.
    Regards
    Sharath

    Hi Littlefoot,
    Another set of information which I felt could be useful.
    In "Home>Application Builder>Application 1000>Page 71>Edit Page Process", under the tab 'Source', I could see the below code. I think I need to make changes here. Please correct me if I am wrong here.
    I need your help to modify this code (as this is an imported application, this code might be written keeping in mind the previous application).
    --PLSQL code for uploading server details
    DECLARE
    v_blob_data      BLOB;
    v_blob_len      NUMBER;
    v_position      NUMBER;
    v_raw_chunk      RAW(10000);
    v_char           CHAR(1);
    c_chunk_len           NUMBER:= 1;
    v_line           VARCHAR2 (32767):= NULL;
    v_data_array      wwv_flow_global.vc_arr2;
    v_rows           NUMBER;
    v_count           NUMBER;
    --for editing
    v_sr_no          NUMBER:=1;
    v_last_char          varchar2(2);
    BEGIN
    -- Read data from wwv_flow_files
    SELECT blob_content INTO v_blob_data FROM wwv_flow_files
    WHERE last_updated = (SELECT MAX(last_updated) FROM wwv_flow_files WHERE UPDATED_BY = :APP_USER)
    AND id = (SELECT MAX(id) FROM wwv_flow_files WHERE updated_by = :APP_USER);
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    -- For removing the first line
    WHILE ( v_position <= v_blob_len )
    LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    EXIT;
    END IF;
    END LOOP;
    -- Read and convert binary to char
    WHILE ( v_position <= v_blob_len )
    LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_line := v_line || v_char;
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    --removing the new line character added in the end of each line
    v_line := substr(v_line, 1, length(v_line)-2);
    --removing the double quotes
    v_line := REPLACE (v_line, '"', '');
    --For checking the absense of data in the end of line
    v_last_char:= substr(v_line,length(v_line),1);
    IF v_last_char = CHR(44) THEN
         v_line :=v_line||'-';
    END IF;
    -- Convert each column separated by , into array of data
    v_data_array := wwv_flow_utilities.string_to_table (v_line, ',');
    -- Insert data into target tables
    --Checking whether the data already exist
    SELECT COUNT(SERVERID) INTO v_count FROM REPOS_SERVERS WHERE SERVERNAME=v_data_array(1);
    IF v_count = 0 THEN
    EXECUTE IMMEDIATE 'INSERT INTO
    REPOS_SERVERS (SERVERID,SERVERNAME,IPADDRESS,OS,SERVER_MODEL,CPU,MEMORY,PLATFORM_TYPE, MACHINE_TYPE,CLUSTERED,LAST_UPDATE_BY,LAST_UPDATE_DATE,REMARKS) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13)'
    USING
    SERVERS_SEQ.NEXTVAL,
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4),
    to_char(NVL(v_data_array(5),NULL)),
    v_data_array(6),
    v_data_array(7),
    v_data_array(8),
    v_data_array(9),
    v_data_array(10),
    v_data_array(11),
    v_data_array(12);
    END IF;
    -- Clearing out the previous line
    v_line := NULL;
    END IF;
    END LOOP;
    END;
    Regards
    Sharath

  • "Invalid Number" error for no apparent reason

    Hi.
    We're transferring data from one table on one DB to a data warehouse on a separate DB. All Oracle 11g running on Windows Server 2003.
    The columns all match data wise, and it's a simple select and insert.
    However, we got an ORA-01722: invalid number error on one run. We checked all the data, which was fine (all 540,000 rows) and ran it again with no error this time.
    I'd like to know if anyone knows why this would happen if there is no issue with the data validity. I'll take all guesses or known issues and check them against our systems. If anyone knows how I can get this to repeat I'd be grateful as it's all running fine now.
    Cheers
    Si

    The data is transferred using a Java program. Select into an OracleResultSet() then read each row result into a prepared statement. Were using the batch send, I believe every 100 rows.
    The source columns match the target columns for name and type, with two exceptions where the column name is slightly different but the column type still matches.
    There are not triggers on either the source or target tables.
    Cheers
    Si

  • 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

  • ORA - 01722: invalid number in Discoverer Desktop/4i

    Hi,
    We have a report that has a date range as parameter. When the report is run for a smaller date range (sometimes specifically 87 days...though this may be a coincidence), the report runs fine. Problem occurs when we want data for a larger period (like an year or 1/2 year), the report errors out with invalid number error. I've seen a lot of messages posted on this topic, but that's not of much help. Any help in this regard is totally appreciated.
    Thanks,
    Alka.

    Here's the select (Please note that incident_date is used for checking the date range):
    SELECT par.party_id
    ,par.party_name customer_name
    ,par.party_number customer_number
    ,inc.incident_date
    ,msi.segment1 item_number
    ,msi.description
    ,ced.quantity_required qty_used
    ,COUNT(msi.segment1) item_count
    FROM cs_incidents_all_b inc
    ,hz_party_sites sit
    ,hz_parties par
    ,cs_estimate_details ced
    ,mtl_system_items_b msi
    ,qp_list_headers_all qlh
    ,qp_list_lines_v qll
    WHERE inc.incident_id = ced.incident_id
    AND ced.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = 123
    AND ced.inventory_item_id = qll.product_attr_value
    AND qll.list_header_id = qlh.list_header_id
    AND inc.install_site_id = sit.party_site_id
    AND sit.party_id = par.party_id
    AND qlh.NAME = 'ABC'
    AND qll.operand >= 25
    and ced.quantity_required>0
    GROUP BY par.party_id
    ,par.party_name
    ,par.party_number
    ,inc.incident_date
    ,msi.segment1
    ,msi.description
    ,ced.quantity_required

  • Interactive Report and the mysterious invalid number

    Hello,
    I have an application that is ready, or so I thought, to be sent to a client to update an existing application. One page in the application has an interactive report that is based on a table in the parsing schema that is joined to the apex_collections view. The report works without issue in my dev environment as well as in the client's test environment. But when a colleague tested the updated app in a different test environment, the report errors out with an ORA-01722: invalid number error.
    Needless to say I'm now hesitant about the update to production because I can't find the cause of the issue on my colleague's machine and would hate for this to happen in production. In trying to find the issue in on my colleague's machine, I first tried removing all of the columns (save the id) from the report to see if it was being generated there, no change. Then I started removing the joins and when the join to the apex_collections view was removed the error disappeared. The join was written as:
    SELECT *
    FROM table tbl
    JOIN apex_collections col
       ON tbl.id = col.c001
    WHERE col.collection_name = 'MY_COLLECTION';I know that the underlying tables for the apex_collections view store columns c001 .. c050 as VARCHAR2(4000) so I was relying on implicit data conversion to apply the join. Perhaps this is where the error is coming from but that would mean that "extra" rows are being returned as all of the c001 values returned in the session (from dev toolbar) are also valid numbers. As I said before, the problem is only occurring in 1 of 3 apex instances so I tested it in a 4th, and again, there was NO problem. I then realized that my query is potentially dangerous if c001 is used to hold something other than a number in the current session, which is NOT the case in any of the instances, but I tried updating the report to the following to see if it would help:
    SELECT *
    FROM table tbl
    JOIN (
       SELECT TO_NUMBER(c001) AS c001
       FROM apex_collections col
       WHERE collection_name = 'MY_COLLECTION'
    ) apex_col
       ON apex_col.c001 = tbl.idThat query worked as expected in the dev environment and will be used as the query going forward. However, it failed to fix the problem in the "problem" instance. This seems to be a local issue but I'd like to know for sure. All of the systems are configured as follows:
    1. Dev - Oracle 10g R2 XE - ApEx 3.1.2 - Works
    2. Test1 - Oracle 10g R2 EE - ApEx 3.1.2 - Works
    3. Test2 (colleague) - Oracle 10g R2 XE - ApEx 3.1.2 - Fails
    4. Test3 (my localhost) - Oracle 10g R2 XE - ApEx 3.1.2 - Works
    5. Prod - Oracle 10g R2 EE - ApEx 3.1.2 - ???
    Any ideas?
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

    Dan,
    I'm always suspicious of problems that disappear without knowing why - usually they reappear the very moment that an end-user starts using the app :D
    You didn't show how you are populating the collection in your original posting, so I'm not clear on exactly what the data would show. What I was thinking was, knowing that collections are all varchar2's, that something like TO_CHAR() had been used in the SQL statement that created the collection.
    I don't think that trimming the data would have any effect. If the problem does happen again, I would suggest creating a report based on the collection (basically doing a data dump onto a page) and then see exactly what is in there. If any number contains a comma (or other characters such as currency symbols), then you have to use a number format string to get back to the actual raw number.
    Andy

  • Invalid Number exception

    Hi experts,
    I have a very strange problem. I have a query to which I am binding a value. The datatype of the value is number. Whenever I am executing the VO for the second time it is throwing ORA-01722: invalid number exception. The value that is being bound is 100% number. The JDBC version I am using is 9.2.0.6.0
    It is reproducible in instance and JDeveloper.
    I have no clue why it is happening. Appreciate if someone can give some pointers.
    Error stack:
    [1814] SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_address[1815] Binding param 1: 4084[1816] ViewObject close single-use prepared statements[1817] QueryCollection.executeQuery failed...[1818] java.sql.SQLException: ORA-01722: invalid number
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)     at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)     at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)     at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)     at oracle.jdbc.ttc7.TTC7Protocol.executeFetch(TTC7Protocol.java:1005)     at oracle.jdbc.dbaccess.DBAccess.executeFetchNeedDefines(DBAccess.java:283)     at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2673)     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)     at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)     at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)     at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:627)     at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:515)     at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3347)     at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)     at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4495)     at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)     at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)     at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)     at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3311)     at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3298)     at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:444)     at tempel.oracle.apps.xxtmg.an.scaleaudit.server.checkCustomersPresentVOImpl.initQuery(checkCustomersPresentVOImpl.java:22)     at tempel.oracle.apps.xxtmg.an.scaleaudit.server.ScaleAuditAMImpl.validateNonFurnSublot(ScaleAuditAMImpl.java:762)     at tempel.oracle.apps.xxtmg.an.scaleaudit.server.webui.ScaleAuditCO.processFormRequest(ScaleAuditCO.java:1005)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:804)     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1157)     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2632)     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1658)     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:501)     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:422)     at OA.jspService(OA.jsp:40)     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)     at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)     at java.lang.Thread.run(Thread.java:534)[1819] checkCustomersPresentVO1>#q old SQLStmtBufLen: 933, actual=903, storing=933[1820] SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_addressJBO-27122: SQL error during statement preparation. Statement: SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_addressoracle.apps.fnd.framework.OAException: JBO-27122: SQL error during statement preparation. Statement: SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_address[1821] OAApplicationPoolImpl.setConnectionReleaseLevel was called with isReleased = true, isReserved = true[1822] setConnectionReleaseLevel - Set connection release level to 1JRAD_PERF : /tempel/oracle/apps/xxtmg/an/scaleaudit/webui/ScaleAuditPG - preparePage : 10045msJRAD_PERF : /tempel/oracle/apps/xxtmg/an/scaleaudit/webui/ScaleAuditPG - renderDocument : 70ms

    I'm just trying to rule out the possiblity of unsynchronized load balanced servers because the issue begaviour is not pointing to code as such otherwise it shouldn't have been happening in a random way. Have you put the trace and seen the value of parameter which is getting binded at the time the error is getting generated.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

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

Maybe you are looking for

  • I need help getting my Thunderbolt display to work with Windows 7 through Bootcamp.

    I recently bought a thunderbolt display and it works great in my Mac environment.  But I recently added Bootcamp and Windows 7 (I need since my Broker Dealer only uses Internet Explorer).  Unfortunately, I can't seem to get Windows to recognize my Th

  • PAL or NTSC Encoding for Mexico?

    I just helped a friend learn how to do movies on a mac who lives in Mexico (Guerrero). It just occurred to me that she may need to encode in PAL down there. Does anyone have any experience with dvd players sold in Mexico and what compressions they re

  • HT5312 my account alreday verify but not working in iphone ? kindly suggest please

    i have verify account of apple id but it's not working in my iphone so please i need your good support how i can enjoying with my iphone ?

  • Query deleted

    Hi all.... One of my queries got deleted from the development system.As we dont have any restriction on authorisation on our dev sys could not able to find out who has done this. Tried all the possible ways ......tried using slg1 tcode....checked in

  • Qosmio G30-182: Drops Wlan connection & then cannot find any Wlans

    I currently use driver v.11.1.0.100 for Intel(R) Pro/Wireless 3945ABG, which is the latest driver I found here at Toshiba. My problem is that I randomly lose my wifi connection, both at my home wlan (using WEP protection) and at my university (WPA-En