"Invalid number" error using Interactive Report search  on collection

hi -- I have several interactive reports based on collections. In the IR reqion query definition,
I cast the collection values as needed (number, date, etc). Everything's been working great.
In both development and production, I can use the search feature of interactive reports
and it finds rows containing the text I type in (as well as everything else working fine...)
I just imported a new version of an application into our production database. Now, when I use the
interactive report search, I always get "invalid number". This even happens on interactive reports
that still work in the previous version of the production application... and these IRS
have not been modified at all.
If I create a filter and search for "elevation" in a string column, the filter works. If I create a filter
searching for "elevation" in a number column, I get "invalid number". (In the development
environment, I can do the latter -- it just doesn't find any rows.)
Clearly it's choking on the types of the columns in the IR... but why now and not before, and why
in the production database but not the development DB? Both are running 4.0.1.00.03.
This is a pretty major loss of functionality... and it comes at a really bad time... Help?!
Thanks,
Carol

hi Andy, Tony -- Completely understand about your email address. I've actually wondered at the fact that any
of you gurus are willing to give them out.
It's not tons of stuff, so here it is.
1) The application process that creates the collection. This process that runs whenever an IR
page is being rendered. The various DB names are application items. This application can affect data
on multiple databases. You'll see see this in the process that builds the query.
IF (apex_collection.collection_exists (      
    p_collection_name=>'IR_COLLECTION')) then
    apex_collection.delete_collection(p_collection_name=>'IR_COLLECTION');
END IF;
apex_collection.create_collection_from_query_b(p_collection_name=>'IR_COLLECTION', p_query=>meta_data_pkg.build_ir_collection_query(:TABLE_NAME, :MASTER_DB_NAME, :CZAR_DB_NAME, :DB_NAME));2) The database function that constructs the query. Called in the above create_collection statement.
FUNCTION build_ir_collection_query (table_name varchar2, master_db_name varchar2, czar_db_name varchar2, ref_db_name varchar2)
return varchar2
IS
  query VARCHAR2(3000);
BEGIN
  IF /* check for other table names here */ THEN
    -- build queries for other tables
   -- *** HDB_EXT_DATA_CODE
  ELSIF (upper(table_name) in ('HDB_EXT_DATA_CODE', 'HDB_EXT_DATA_CODE_SYN')) THEN
    query := 'SELECT /*+DRIVING_SITE(dcs)*/ dc.ext_data_code_sys_id, dcs.ext_data_code_sys_name, dcs.agen_id, a.agen_name, dc.primary_data_code,';
    query := query||' dc.secondary_data_code, dc.hdb_datatype_id, d.datatype_name, d.unit_id, u.unit_name, d.physical_quantity_name, to_char(dc.date_time_loaded,''DD-MON-YYYY HH24:MI:SS'')';
    query := query||' FROM hdb_ext_data_code_syn@'||master_db_name || ' dc, hdb_ext_data_code_sys_syn@'||master_db_name ||
             ' dcs, hdb_agen_syn@'||master_db_name||' a, hdb_datatype_syn@'||master_db_name||' d, hdb_unit@'||czar_db_name||' u';
    query := query||' WHERE dc.ext_data_code_sys_id = dcs.ext_data_code_sys_id AND dcs.agen_id = a.agen_id(+) AND dc.hdb_datatype_id = d.datatype_id AND d.unit_id = u.unit_id';
   /* continue w/ other tables */
END;3) The query that it builds for the table in question:
SELECT /*+DRIVING_SITE(dcs)*/ dc.ext_data_code_sys_id, dcs.ext_data_code_sys_name, dcs.agen_id, a.agen_name,
dc.primary_data_code, dc.secondary_data_code, dc.hdb_datatype_id, d.datatype_name, d.unit_id, u.unit_name,
d.physical_quantity_name, to_char(dc.date_time_loaded,'DD-MON-YYYY HH24:MI:SS')
FROM hdb_ext_data_code_syn@UCHDB2 dc,  hdb_ext_data_code_sys_syn@UCHDB2 dcs, hdb_agen_syn@UCHDB2 a,
hdb_datatype_syn@UCHDB2 d, hdb_unit@UCHDB2 u
WHERE dc.ext_data_code_sys_id = dcs.ext_data_code_sys_id AND dcs.agen_id = a.agen_id(+)
AND dc.hdb_datatype_id = d.datatype_id AND d.unit_id = u.unit_id           4) The explain plan results on the development database
PLAN_TABLE_OUTPUT                                                                                  
Plan hash value: 583729845                                                                         
| Id  | Operation                       | Name                  | Rows  | Bytes | Cost (%CPU)| Time
    | Inst   |                                                                                     
|   0 | SELECT STATEMENT REMOTE         |                       |    97 | 16490 |    19  (16)| 00:00
:01 |        |                                                                                     
|*  1 |  HASH JOIN                      |                       |    97 | 16490 |    19  (16)| 00:00
:01 |        |                                                                                     
|   2 |   TABLE ACCESS FULL             | HDB_UNIT              |   177 |  3540 |     3   (0)| 00:00
:01 | UCHDB2 |                                                                                     
|*  3 |   HASH JOIN RIGHT OUTER         |                       |    95 | 14250 |    15  (14)| 00:00
:01 |        |                                                                                     
|   4 |    TABLE ACCESS FULL            | HDB_AGEN              |    54 |  1944 |     3   (0)| 00:00
:01 | UCHDB2 |                                                                                     
|*  5 |    HASH JOIN                    |                       |    95 | 10830 |    12  (17)| 00:00
:01 |        |                                                                                     
|   6 |     MERGE JOIN                  |                       |   112 |  5936 |     6  (17)| 00:00
:01 |        |                                                                                     
|   7 |      TABLE ACCESS BY INDEX ROWID| HDB_EXT_DATA_CODE_SYS |    15 |   405 |     2   (0)| 00:00
:01 | UCHDB2 |                                                                                     
|   8 |       INDEX FULL SCAN           | HDB_EXT_DATA_CODE_SYS |    15 |       |     1   (0)| 00:00
:01 | UCHDB2 |                                                                                     
|*  9 |      SORT JOIN                  |                       |   112 |  2912 |     4  (25)| 00:00
:01 |        |                                                                                     
|  10 |       TABLE ACCESS FULL         | HDB_EXT_DATA_CODE     |   112 |  2912 |     3   (0)| 00:00
:01 | UCHDB2 |                                                                                     
|  11 |     TABLE ACCESS FULL           | HDB_DATATYPE          |   711 | 43371 |     5   (0)| 00:00
:01 | UCHDB2 |                                                                                     
Predicate Information (identified by operation id):                                                
   1 - access("A2"."UNIT_ID"="A1"."UNIT_ID")                                                       
   3 - access("A4"."AGEN_ID"="A3"."AGEN_ID"(+))                                                    
   5 - access("A5"."HDB_DATATYPE_ID"="A2"."DATATYPE_ID")                                           
   9 - access("A5"."EXT_DATA_CODE_SYS_ID"="A4"."EXT_DATA_CODE_SYS_ID")                             
       filter("A5"."EXT_DATA_CODE_SYS_ID"="A4"."EXT_DATA_CODE_SYS_ID")                             
Note                                                                                               
   - fully remote statement                                                                         5) The explain plan results on the production database
PLAN_TABLE_OUTPUT                                                                                                                                                                  
Plan hash value: 583729845                                                                                                                                                         
| Id  | Operation                       | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |                                                                          
|   0 | SELECT STATEMENT                |                       |    97 | 16490 |    19  (16)| 00:00:01 |                                                                          
|*  1 |  HASH JOIN                      |                       |    97 | 16490 |    19  (16)| 00:00:01 |                                                                          
|   2 |   TABLE ACCESS FULL             | HDB_UNIT              |   177 |  3540 |     3   (0)| 00:00:01 |                                                                          
|*  3 |   HASH JOIN RIGHT OUTER         |                       |    95 | 14250 |    15  (14)| 00:00:01 |                                                                          
|   4 |    TABLE ACCESS FULL            | HDB_AGEN              |    54 |  1944 |     3   (0)| 00:00:01 |                                                                          
|*  5 |    HASH JOIN                    |                       |    95 | 10830 |    12  (17)| 00:00:01 |                                                                          
|   6 |     MERGE JOIN                  |                       |   112 |  5936 |     6  (17)| 00:00:01 |                                                                          
|   7 |      TABLE ACCESS BY INDEX ROWID| HDB_EXT_DATA_CODE_SYS |    15 |   405 |     2   (0)| 00:00:01 |                                                                          
|   8 |       INDEX FULL SCAN           | HDB_EXT_DATA_CODE_SYS |    15 |       |     1   (0)| 00:00:01 |                                                                          
|*  9 |      SORT JOIN                  |                       |   112 |  2912 |     4  (25)| 00:00:01 |                                                                          
|  10 |       TABLE ACCESS FULL         | HDB_EXT_DATA_CODE     |   112 |  2912 |     3   (0)| 00:00:01 |                                                                          
|  11 |     TABLE ACCESS FULL           | HDB_DATATYPE          |   711 | 43371 |     5   (0)| 00:00:01 |                                                                          
Predicate Information (identified by operation id):                                                                                                                                
   1 - access("D"."UNIT_ID"="U"."UNIT_ID")                                                                                                                                         
   3 - access("DCS"."AGEN_ID"="A"."AGEN_ID"(+))                                                                                                                                    
   5 - access("DC"."HDB_DATATYPE_ID"="D"."DATATYPE_ID")                                                                                                                            
   9 - access("DC"."EXT_DATA_CODE_SYS_ID"="DCS"."EXT_DATA_CODE_SYS_ID")                                                                                                            
       filter("DC"."EXT_DATA_CODE_SYS_ID"="DCS"."EXT_DATA_CODE_SYS_ID")                                                                                                             6) This is the source query for the interactive report in question. The application process that creates the
collection runs before this region is rendered.
Select /*+ NO_QUERY_TRANSFORMATION */
to_number(C001) Ext_Data_Code_Sys_Id,
C002 Ext_Data_Code_Sys_Name,
to_number(C003) Agen_Id,
C004 Agen_Name,
C005 Primary_Data_Code,
C006 Secondary_Data_Code,
to_number(C007) Hdb_Datatype_Id,
C008 Datatype_Name,
to_number(C009) Unit_Id,
C010 Unit_Name,
C011 Physical_Quantity_Name,
C012 Date_Time_Loaded
from apex_collections
where collection_name = 'IR_COLLECTION'
order by 1,5,7Well, maybe it is alot... !
Happy New Year!
Carol

Similar Messages

  • Invalid Number Error in IR search bar.

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

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

  • ORA-01722 Invalid Number Error - report parameter

    I have a report which runs successfully using the following simple select statement: -
    select u.user_id, u.user_forename||' '||u.user_surname user_name,
    fo.flight_number_in, fo.sta, fo.ata, fo.flight_number_out, fo.std, fo.atd
    from users u, flight_operations_employees foe, flight_operations fo
    where NVL(fo.sta, fo.std) between :P_Start and :P_End and
    fo.record_number = foe.record_number and
    u.user_id = foe.user_id
    order by u.user_surname
    Where P_Start and P_End are parameters passed from a form. I want to add further user option selections for the report and have added another parameter (P_inClause) where the user can select one or more items to select from. The column selected is a number on the table. I then want to pass this as another parameter into the report listing a number of valid values using the IN statement. The updated select statement is: -
    select u.user_id, u.user_forename||' '||u.user_surname user_name,
    fo.flight_number_in, fo.sta, fo.ata, fo.flight_number_out, fo.std, fo.atd
    from users u, flight_operations_employees foe, flight_operations fo
    where NVL(fo.sta, fo.std) between :P_Start and :P_End and
    fo.record_number = foe.record_number and
    u.user_id = foe.user_id and
    u.user_id IN :P_inClauseorder by u.user_surname
    u.user_id is a number column in the table. The value of P_inClause is set as a character parameter in the report and has the value (45,5,13,26) - as an example.
    When I try running the report interactively it comes up with the ORA-01722 : Invalid Number error and points to the P_inClause parameter. If I type in the value directly into the select statement it works fine.
    Do you have any ideas as to how I can make this work?
    Regards
    Edited by: Buzzer on Apr 13, 2011 12:44 PM

    You can search this forum for "in clause", e.g.:
    Re: how to pass values to where conditon

  • JavaScript error on Interactive Report

    When clicking on the Magnifying glass of my interactive report search bar, I receive a JavaScript error.
    Line: 2 Char: 15193 Error: Syntax Error
    The page that I am navigating to has 2 regions. The first is an interactive report and the second is an html region that has an Iframe reference to another interactive report. Based upon the selection of a radio group, the corresponding region(interactive report) displays. All other interactive reports work fine when their pages don't have a region with a Iframe reference.
    If I navigate to another page after the error occurs and then come back to the page, everything then works fine. The error only happens on the first use. I have installed the latest patch set for Apex 3.2 I currently am running 3.2.1.00.11. I read a bug on Metalink that referenced this javascript error, but applying the patch set does not seem to fix the issue. The bug was 8568894.
    Any help would be appreciated.

    This might be useful for others also...
    After hours and hours of debugging headers and responses and comparing pages to others which work, I realised that this interactive report's display condition is based on REQUEST = SUBMIT.
    As such, the actions menu will NOT set the Request parameter when clicking in the actions menu and the Apex engine refuses to send anything back to the browser - not even an error message.
    I'll raise a bug for this via Oracle Support.
    Cheers, Pete

  • Another ORA-01722: invalid number Error

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

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

  • Invalid Number Error Please help Urgent

    Hi,
    I am trying to create a report in discoverer where in I get an invalid number error for the statement
    ,DECODE(final.TYP,'Sales',to_char(final.future_supplpy),'B/O','B/O') sale_type.
    We have the requirement that when TYP is Sales i need to display future supply and when the TYP is B/O i need to display B/O.
    The query runs perfectly fine in TOAD but in Discoverer Desktop when i run the report i get an error message
    invalid number.
    Please help its urgent
    Thanks
    Ashwini

    Hi Ashwani
    First of all, your statement appears to not be handling anything other than Sales or B/O. Is that deliberate? If not, you need a default, catch all value at the end like this:
    DECODE(final.TYP,'Sales',NVL(final.future_supply,to_char(final.future_supply),'B/O','B/O', default_value) sale_type
    You also might want to make sure there aren't any NULL values in future_supply or in TYP and if there are you might want to consider using an NVL for these, like this:
    DECODE(final.TYP,'Sales',NVL(to_char(final.future_supply,NULL),'B/O','B/O', default_value) sale_type
    Also, when using DECODE you don't always need to use TO_CHAR as the DECODE conversion to a string typically takes place automatically. CASE is different as it insists that all results are of the same data type.
    Hope this helps
    Best wishes
    Michael

  • To_number function and the "invalid number" error

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

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

  • 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

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

  • Invalid number error for bind dialog

    Oracle SQL Developer version 1.1.2.25 BUILD MAIN-25.79
    Running under WinXP
    Issue description:
    We get an invalid number error when bind variable filled with an enter in the bind dialog

    It is hard to say what is causing your problem without the specifics (ie query and value entered for the bind variable). Try running the same statement with the value of the bind variable in place of the bind variable (ie instead of running "select * from dual where dummy = :var" with a value of 'x' for :var, run "select * from dual where dummy = 'x'"). If you get the same error, then it is not an issue with the use of bind variables.
    Be aware that currently you cannot define the data type of bind variables (unlike TOAD, etc) and they are all treated as character values. I wouldn't have thought that this would cause you problem unless you are using a bind variable to restrict a numeric column to a specific value and you are entering a non-numeric bind (ie "select * from people where person_id = :id" and using 'xyz' as the value for :id).

  • Please help: Case Statement - ORA-01722: invalid number Error

    Hi All,
    I'm trying to use Case statement to recode Cancelled statuses into two groups
    'Reject' if the difference between first date and last date is less than 29 and
    'Accept' if the difference between first date and last date is greater than 30
    Here is my 'test' data:
    STATUS     FIRST_DATE     LAST_DATE
    Transfer     10/08/2011     10/09/2011
    Mover     10/08/2011     15/09/2011
    Cancel     10/08/2011     16/09/2011
    Cancel     10/08/2011     5/09/2011
    Here is the syntax
    select a.*,
    (CASE WHEN a.STATUS ='Cancel' THEN (round(a.LAST_DATE-a.FIRST_DATE))
    ELSE 0
    END) CAN_DAYS,
    (CASE WHEN 'CAN_DAYS' >29 THEN 'Reject'
    WHEN 'CAN_DAYS' <30 THEN 'Accept'
    END) Reject_Accept
    from test a
    The first CASE statement works fine and gives me this
    STATUS     FIRST_DATE     LAST_DATE     CAN_DAYS
    Transfer     10/08/2011     10/09/2011     0
    Mover     10/08/2011     15/09/2011     0
    Cancel     10/08/2011     16/09/2011     37
    Cancel     10/08/2011     5/09/2011     26
    but the second CASE produces ORA-01722: invalid number Error. It is something to do with the CAN_DAYS data type, Oracle doesn't see it as Numeric i think.
    The result i want to see would be
    STATUS     FIRST_DATE     LAST_DATE     CAN_DAYS Reject_Accept
    Transfer     10/08/2011     10/09/2011     0
    Mover     10/08/2011     15/09/2011     0
    Cancel     10/08/2011     16/09/2011     37 Accept
    Cancel     10/08/2011     5/09/2011     26 Reject
    Could someone please help me to fix the syntax?
    Thank you in advance,

    This seems to give you your desired results...
    with test as
      ( select 'Transfer' as status, to_date('10/08/2011') as first_date, to_date('10/09/2011') as last_date  from dual union all
        select 'Mover'             , to_date('10/08/2011')              , to_date('15/09/2011')               from dual union all
        select 'Cancel'            , to_date('10/08/2011')              , to_date('16/09/2011')               from dual union all
        select 'Cancel'            , to_date('10/08/2011')              , to_date('05/09/2011')               from dual
    select  status
         ,  first_date
         ,  last_date
         ,  CAN_DAYS
         ,  CASE
              WHEN CAN_DAYS =   0 THEN NULL
              WHEN CAN_DAYS <  30 THEN 'Reject'
              WHEN CAN_DAYS >= 30 THEN 'Accept'
            END  Reject_Accept
      from  ( select  status
                   ,  first_date
                   ,  last_date
                   ,  CASE
                        WHEN STATUS ='Cancel' THEN round(LAST_DATE-FIRST_DATE)
                        ELSE 0
                      END  CAN_DAYS
                from  test
    ;

  • ORA-01722: invalid number error with Bulk collect

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

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

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

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

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

  • Ora-01722 invalid number error within view

    Hi, in my oracle 9.2.0.4.0 db, under TEST schema i've a view called PRODUTTIVITA_LINEE. I'm trying to create another view joining PRODUTTIVITA_LINEE with a table called LINEE. But when i execute the select (SELECT PRODUTTIVITA_LINEE.*, LINEE.NAME FROM PRODUTTIVITA_LINEE, LINEE WHERE PRODUTTIVITA_LINEE.LINEA_ID = LINEE.LINEA_ID), i obtain the ORA-01722 invalid number error.
    But if i create a table PRODUTTIVITA_SUPPORT as select all fields from PRODUTTIVITA_LINEE and i use it in the new query (SELECT PRODUTTIVITA_SUPPORT.*, LINEE.NAME FROM PRODUTTIVITA_SUPPORT, LINEE WHERE PRODUTTIVITA_SUPPORT.LINEA_ID = LINEE.LINEA_ID), all works.
    Using the view, the new query doesn't work, but using the same data toke from a table instead of view, all works. Why?

    Excuse me but i send modified script. Here the original script of object.
    SQL> desc PRODUTTIVITA_LINEE;
    Nome                               Nullo?   Tipe
    LINEA_ID                   NUMBER(9)           
    COD_LINEA_ANDATA                 VARCHAR2(8)        
    COD_LINEA_RITORNO                VARCHAR2(4)        
    ID_TRAT_PIC_ANDATA                NUMBER               
    ID_TRAT_PIC_RITORNO               NUMBER               
    DESC_LINEA                              VARCHAR2(120)     
    EKM_NOMINALI                         NUMBER                 
    EKM_SCONTATI                        NUMBER                 
    KMLINEA                                  NUMBER                 
    ANNO                                       NUMBER                  SQL> desc PRODUTTIVITA_SUPPORT;
    Nome                           Nullo?     Tipe
    LINEA_ID             NUMBER(9)
    COD_LINEA_ANDATA           VARCHAR2(8)
    COD_LINEA_RITORNO          VARCHAR2(4)
    ID_TRAT_PIC_ANDATA          NUMBER
    ID_TRAT_PIC_RITORNO         NUMBER
    DESC_LINEA                      VARCHAR2(120)
    EKM_NOMINALI                     NUMBER
    EKM_SCONTATI                   NUMBER
    KMLINEA                            NUMBER
    ANNO                                NUMBER Both objects have 5400 records and are the same.

Maybe you are looking for

  • How to relink media in CS6

    When I first open a project in PrPro it asks a strange request to relink media.  No files have been moved and all my media is on one hard drive.  I understand how to relink media but this is strange.  It asks "Where is the File "V1-etc, etc, etc?  I'

  • Client certificate not being presented by Sun JDK

    I have a requirement to connect to an external service provider (SP) using an https get. The SP has a server certificate that I have imported to my trust store. The SP issued a private key and an intermediate certificate that I have included in my ke

  • App created with DPS only works while on WIFI

    I have created an app in InDesign and went through all the steps to create an .ipa. I then loaded it onto my ipad. The app works fine on the iPad only went it is connected to wifi. Once I disable any connection the animations in the app do not ever l

  • HT5163 my iphone 4s is unlock to orange uk ileft orange gon to tesco o2 because i left will not unlock it will you ulock

    hi my iphone 4s is unlock to orange uk i left orange gon to tesco o2 i  have unlock sim but orange will not unlock my phone because i left will you unlock it for me <Personal Information Edited By Host>

  • Problem with complex folder

    Hi, We have our EUL set up and working fine until last week. Today I received a call from the user saying that they are unable to open any workbooks, complaining that it has lost the joins. Upon investigation found that, these workbooks are built upo