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

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

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

Similar Messages

  • ORA-20006: ORA-01722: invalid number ORA-06512: at "APPS.WF_NOTIFICATION"

    Hi,
    I am having a wft program, which checks a function activity and depending on the value returned sends difference notifications.
    The package body completed successfully from backend and while running the workflow program it sends a notification also. But while opening the notification it gives the following error,
    ORA-20006: ORA-01722: invalid number ORA-06512: at "APPS.WF_NOTIFICATION", line 5328 ORA-06512: at line 5
    I have 3 procedures in my package body and all the 3 procedures have exceptions defined as follows, if they are using any workflow activities.
    ==========================================================
    EXCEPTION
         WHEN OTHERS THEN
              WF_CORE.context (
              'WFCustCheck',
              'MisCustDataFromTableDoc',
              document_id,
              display_type,
              document,
              document_type,
              SQLERRM
    RAISE_APPLICATION_ERROR (-20006, SQLERRM);
    ==========================================================
    But I am not able to figure out what is causing this error. What does this "line 5328 ORA-06512: at line 5" in the error message indicate?. My package body has only 600 lines. And why is the error message not displaying the procedure name? though I have defined the procedure name in the exception.
    What is the best way to get the procedure name in the error message? So that it becomes easier for identifying which procedure is causing the erro?
    Please let me know.
    Thanks

    Hi,
    Instead of the RAISE_APPLICATION_ERROR command, just replace that with RAISE;
    The error is coming out of the package that is sending the notification (WF_NOTIFICATION), which is invoked when you open the notification. I'm guessing that line 5 is the line in your code though.
    Are you using documents to send the notification, or are they purely defined in the .wft file?
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com
    NEW! - WorkflowFAQ Blog at http://thoughts.workflowfaq.com

  • Select query with UNION clause in database adapter

    Friends,
    I have got a SQL query with two UNION clause withing it. like
    select a,b,c
    from a
    union
    select a,b,c
    from b
    The schema generated is like below in sequence
    <element>a</element>
    <element>b</element>
    <element>c</element>
    <element>a</element>
    <element>b</element>
    <element>c</element>
    So, the columns from different select queries joined with UNION clause are all appeared in schema instead of the distinct columns.
    Is there any way around to solve this issue ? or will need to with DB function/procedure.

    I think I know what you are saying but your example doesn't make sense, your SQL should produce something like
    I had to change a, b, c with elementA, elementB, elementC as a and b are reserved html tags.
    <elementA>DateA</elementA>
    <elementB>DataB</elementB>
    <elementC>DataC</elementC>
    ...What is the result of the query when you run it in SQLPlus? Is it what you expect?
    cheers
    James

  • Pipelined function with huge volume

    Hi all,
    I have a table of 5 million rows with an average length of 1K for each row (dss system).
    My SGA is 2G and PGA 1G.
    I wonder if a pipelined function could support a such volume ?
    Does anyone have already experienced a pipelined function with a huge volume ?
    TIA
    Yang

    Hello
    Well, just over a month later and we're pretty much sorted. Our pipelined functions were not the cause of the excessive memory consumption and the processes are are now no longer consuming as much PGA as they were previously. Here's what I've learnt.
    1. Direct write operations on partitioned tables require two direct write buffers to be allocated per partition. By default, these buffers are 256K each so it's 512K per partition. We had a table with 241 partitions which meant we inadvertently allocating 120MB of PGA without even trying. This is not a problem with pipelined functions.
    2. In 10.2 the total size of the buffers will be kept below the pga_aggregate_target, or 64k per buffer, whichever is higher. This is next to useless though as to really constrain the size of the buffers at all, you need a ridiculously small pga_aggregate_target.
    3. The size of the buffers can be as low as 32k and can be set using an undocumented parameter "_ldr_io_size". In our environment (10.2.0.2 Win2003 using AWE) I've set it to 32k meaning there will be 64k worth of buffers allocated to each partition significantly reducing the amount of PGA required.
    4. I never want to speak to Oracle support again. We had a severity 1 SR open for over a month and it took the development team 18 days to get round to looking at the test case I supplied. Once they'd looked at it, they came back with the undocumented parameter which worked, and the ridiculous suggestion that I set the PGA aggregate target to 50MB on a production box with 4GB and 300+ dedicated connections. No only that, they told me that a pga_aggregate_target of 50MB was sensible and did so in the most patronising way. Muppets.
    So in sum, our pipelined functions are working exceptionally well. We had some scary moments as we saw huge amounts of PGA being allocated and then 4030 memory errors but now it's sorted and chugging along nicely. The throughput is blistering especially when running in parallel - 200m rows generated and inserted in around 1 hour.
    To give some background on what we're using pipelined functions for....
    We have a list of master records that have schedules associated with them. Those schedules need to be exploded out to an hourly level and customised calendars need to be applied to them along with custom time-zone-style calculations. There are various lookups that need to be applied to the exploded schedules and a number of value calculations based on various rules. I did originally implement this in straight SQL but it was monsterous and ran like a dog. The SQL was highly complex and quite quickly became unmanageable. I decided to use pipelined functions because
    a) It immensely simplified the logic
    b) It gave us a very neat way to centralise the logic so it can be easily used by other systems - PL/SQL and SQL
    c) We can easily see what it is doing and make changes to the logic without affecting execution plans etc
    d) Its been exceptionally easy to tune using DBMS_PROFILER
    So that's that. I hope it's of use to anyone who's interested.
    I'm off to get a "pipelined fuinctions rule" tattoo on my face.
    David

  • Pipelined function with lagre amount of data

    We would like to use pipelined functions as source of the select statements instead of tables. Thus we can easily switch from our tables to the structures with data from external module due to the need for integration with other systems.
    We know these functions are used in situations such as data warehousing to apply multiple transformations to data but what will be the performance in real time access.
    Does anyone have any experience using pipelined function with large amounts of data in the interface systems?

    It looks like you have already determined that the datatable object will be the best way to do this. When you are creating the object, you must enter the absolute path to your spreadsheet file. Then, you have to create some type of connection (i.e. a pushbutton or timer) that will send a true to the import data member of the datatable object. After these two things have been done, you will be able to access the data using the A3 - K133 data members.
    Regards,
    Michael Shasteen
    Applications Engineering
    National Instruments
    www.ni.com/ask
    1-866-ASK-MY-NI

  • SQL statement with union clause

    Hi,
    I have a scenario where i need to generate a sql statement with UNION .
    Eg:
    SELECT B.YY_ID,
    FROM XXXX.YY B
    WHERE (B.YY_TY= 'as')
    UNION
    SELECT B.YY_ID
    FROM XXXX.YY_ALT_NAME A, XXXX.YY B
    WHERE (A.YY_TY= 'zx'
    AND (B.YY_ID=A.YY_ID)"
    I tried ns1:table1() union ns3:table2() in XQuery.
    But it is pushdown as 2 seperate sqls.
    Is it possible to create XQuery that pushdown as SINGLE SQL statement with union clause ?
    Thanks

    No. See 3.1.1.5 in the document I referenced in your previous post.

  • Pipelined Function with execute immediate

    Hello Experts,
    I have created a Pipe lined function with execute immediate, due to below requirement;
    1) Columns in where clause is passed dynamically.
    2) I want to know the data stored into above dynamic columns.
    3) I want to use it in report, so I don't want to insert it into a table.
    I have created a TYPE, then through execute immediate i have got the query and result of that query will be stored in TYPE.
    But when calling the function i am getting
    ORA-00932: inconsistent datatypes: expected - got -
    Below is my function and type, let me know i am going wrong, and is my logic correct.
    CREATE OR REPLACE TYPE OBJ_FPD AS OBJECT
                      (LOW_PLAN_NO VARCHAR2 (40),
                       FPD VARCHAR2 (5),
                       SERIAL_NO NUMBER,
                       CEDIA_CODE VARCHAR2 (2),
                       DT DATE);
    CREATE OR REPLACE TYPE FPD_TBL_TYPE AS TABLE OF OBJ_FPD;
    CREATE OR REPLACE FUNCTION FUNC_GET_FPD_DATE (P_LOW_PLAN_NO    VARCHAR2,
                                                  P_CEDIA_CODE     VARCHAR2,
                                                  P_SERIAL_NO      NUMBER)
       RETURN FPD_TBL_TYPE
       PIPELINED
    AS
       CURSOR C1
       IS
              SELECT 'FPD' || LEVEL TBL_COL
                FROM DUAL
          CONNECT BY LEVEL <= 31;
       V_STR        VARCHAR2 (5000);
       V_TBL_TYPE   FPD_TBL_TYPE;
    BEGIN
       FOR X IN C1
       LOOP
          V_STR :=
                'SELECT A.low_PLAN_NO,
               A.FPD,
               A.SERIAL_NO,
               A.cedia_code,
               TO_DATE (
                     SUBSTR (FPD, 4, 5)
                  || ''/''
                  || TO_CHAR (C.low_PLAN_PERIOD_FROM, ''MM'')
                  || ''/''
                  || TO_CHAR (C.low_PLAN_PERIOD_FROM, ''RRRR''),
                  ''DD/MM/RRRR'')
                  DT FROM ( SELECT low_PLAN_NO, '
             || ''''
             || X.TBL_COL
             || ''''
             || ' FPD, '
             || X.TBL_COL
             || ' SPTS, SERIAL_NO, cedia_code FROM M_low_PLAN_DETAILS WHERE NVL('
             || X.TBL_COL
             || ',0) > 0 AND SERIAL_NO = '
             || P_SERIAL_NO
             || ' AND cedia_code = '
             || ''''
             || P_CEDIA_CODE
             || ''''
             || ' AND low_PLAN_NO = '
             || ''''
             || P_LOW_PLAN_NO
             || ''''
             || ') A,
               M_low_PLAN_DETAILS B,
               M_low_PLAN_MSTR C
         WHERE     A.low_PLAN_NO = B.low_PLAN_NO
               AND A.cedia_code = B.cedia_code
               AND A.SERIAL_NO = B.SERIAL_NO
               AND B.low_PLAN_NO = C.low_PLAN_NO
               AND B.CLIENT_CODE = C.CLIENT_CODE
               AND B.VARIANT_CODE = C.VARIANT_CODE
    CONNECT BY LEVEL <= SPTS';
          EXECUTE IMMEDIATE V_STR INTO V_TBL_TYPE;
          FOR I IN 1 .. V_TBL_TYPE.COUNT
          LOOP
             PIPE ROW (OBJ_FPD (V_TBL_TYPE (I).LOW_PLAN_NO,
                                V_TBL_TYPE (I).FPD,
                                V_TBL_TYPE (I).SERIAL_NO,
                                V_TBL_TYPE (I).CEDIA_CODE,
                                V_TBL_TYPE (I).DT));
          END LOOP;
       END LOOP;
       RETURN;
    EXCEPTION
       WHEN OTHERS
       THEN
          RAISE_APPLICATION_ERROR (-20000, SQLCODE || ' ' || SQLERRM);
          RAISE;
    END;Waiting for your views.
    Regards,

    Ora Ash wrote:
    Hello Experts,
    I have created a Pipe lined function with execute immediate, due to below requirement;
    1) Columns in where clause is passed dynamically.No, that's something you've introduced, and is due to poor database design. You appear to have columns on your table called FPD1, FPD2 ... FPD31. The columns do not need to be 'passed dynamically'
    2) I want to know the data stored into above dynamic columns.And you can know the data without it being dynamic.
    3) I want to use it in report, so I don't want to insert it into a table.That's fine, though there's no reason to use a pipelined function.
    You also have an pointless exception handler, which masks any real errors.
    I'm not quite sure what the point of your "connect by" is in your query as we don't have your tables or data or know for sure what the expected output is.
    However, in terms of handling the 'dynamic' part that you've introduced, then you would be looking at doing something along the following lines, using a static query that requires no poor dynamic code, and no pipelined function...
    with x as (select level as dy from dual connect by level <= 31)
    select a.low_plan_no
          ,a.fpd
          ,a.serial_no
          ,a.cedia_code
          ,trunc(c.low_plan_period_from)+a.dy-1 as dt
    from  (select low_plan_no
                 ,dy
                 ,'FPD'||dy as fpd
                 ,spts
                 ,serial_no
                 ,cedia_code
           from (
                 select low_plan_no
                       ,x.dy
                       ,case x.dy when 1 then fpd1
                                  when 2 then fpd2
                                  when 3 then fpd3
                                  when 4 then fpd4
                                  when 5 then fpd5
                                  when 6 then fpd6
                                  when 7 then fpd7
                                  when 8 then fpd8
                                  when 9 then fpd9
                                  when 10 then fpd10
                                  when 11 then fpd11
                                  when 12 then fpd12
                                  when 13 then fpd13
                                  when 14 then fpd14
                                  when 15 then fpd15
                                  when 16 then fpd16
                                  when 17 then fpd17
                                  when 18 then fpd18
                                  when 19 then fpd19
                                  when 20 then fpd20
                                  when 21 then fpd21
                                  when 22 then fpd22
                                  when 23 then fpd23
                                  when 24 then fpd24
                                  when 25 then fpd25
                                  when 26 then fpd26
                                  when 27 then fpd27
                                  when 28 then fpd28
                                  when 29 then fpd29
                                  when 30 then fpd30
                                  when 31 then fpd31
                        else null
                        end as spts
                       ,serial_no
                       ,cedia_code
                 from   x cross join m_low_plan_details
                 where  serial_no = p_serial_no
                 and    cedia_code = p_cedia_code
                 and    low_plan_no = p_low_plan_no
           where  nvl(spts,0) > 0
          ) A
          join m_low_plan_details B on (    A.low_plan_no = B.low_plan_no
                                        and A.cedia_code = B.cedia_code
                                        and A.serial_no = B.serial_no
          join m_low_plan_mstr C on (    B.low_plan_no = C.low_plan_no
                                     and B.client_code = C.client_code
                                     and B.variant_code = C.variant_code
    connect by level <= spts;... so just remind us again why you think it needs to be dynamic?

  • Using pipelined functions with bind variables in Apex...

    Hy all:
    I have a table which has about 10 million records and it is hanging up the system when it is trying to retrieve the data from that table... so what I have done is I created a pripelined
    function and then trying to retrieve data using an SQL statement ... when I try to use a bind variable to filter by the date and location it is binding according to the location
    but not by date ... can anyone help me in this please!!
    Help greatly appreciated !
    Thanks in advance !

    Hi Denes:
    Create or replace type ohe1 as object (
    IMLITM NCHAR(50), IMAITM NCHAR(50), IMDSC1 NCHAR(60), COUNCS NUMBER(22), LIPQOH NUMBER(22),
    LIMCU NCHAR(24), LILOCN NCHAR(40), LILOTN NCHAR(60), LILOTS NCHAR(2), IOMMEJ NUMBER(22))
    CREATE OR REPLACE TYPE OHE AS TABLE OF Ohe1
    CREATE OR REPLACE FUNCTION GET_ohe
    return OHE PIPELINED
    IS
    m_rec ohe1:= ohe1 (NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,0);
    begin
    for c in (select f1.LITM LITM, F1.AITM AITM, F1.DSC1 DSC1, F5.UNCS UNCS,
    F21.QOH QOH, F21.MCU MCU, F21.LOCN LOCN, F21.LOTN LOTN, F21.LOTS LOTS,
    F8.MEJ MEJ FROM F1 F1, F2 F2, F21 F21, F5 F5, F8 F8
    WHERE (F5.EDG='07') AND (F21.QOH != 0) AND F2.IBITM = F1.IMITM
    AND F21.ITM = F2.ITM AND F21.ITM = F5.ITM AND F21.MCU = F5.MCU
    AND F21.MCU = F2.MCU AND F21.LOTN = F8.LOTN AND F21.MCU = F8.MCU)
    loop
    m_rec.LITM:=c.LITM;
    m_rec.AITM:=c.AITM;
    m_rec.DSC1:=c.DSC1;
    m_rec.UNCS:=c.UNCS;
    my_record.QOH:=c.QOH;
    my_record.MCU:=c.MCU;
    my_record.LOCN:=c.LOCN;
    my_record.LOTN:=c.LOTN;
    my_record.LOTS:=c.LOTS;
    my_record.MEJ:=c.MEJ;
    PIPE ROW (my_record);
    end loop;
    return;
    end;
    select LITM , AITM , DSC1 , UNCS*.0001 UNCS, QOH*.0001 QOH, (UNCS*.0001)*(QOH*.0001) AMOUNT,
    MCU MCU, LOCN LOCN, LOTN LOTN, LOTS LOTS, jdate(DECODE(MEJ,0,100001,MEJ)) MEJ FROM
    TABLE (GET_ohe)
    WHERE trim(LIMCU)= TRIM(:OHE_BRANCHID)
    AND (jdate(DECODE(MEJ,0,10001,MEJ)) >=:FROMEXPDT
    AND jdate(DECODE(MEJ,0,10001,MEJ)) <=:TOEXPDATE)
    The MEJ is a julian date and I am trying to convert it into a date ..... using the function jdate! and the pipelined function is created without any errors
    and I am able to get the data with correct branch location bind variable but only problem is it is not binding the date filters in the sql.....
    Thanks
    Edited by: user10183758 on Oct 16, 2008 8:17 AM

  • Apex3.2.1 pipelined functions with parameters send cpu to 100 percent

    I have just installed 11g and exported a schema from 10g into it.
    When I run Apex3.2.1 and open a page with a flash chart that running off a table object populated by a pipelined function the CPU goes in overload 100%.
    I have tracked the problem to parameters on the pipelined function if I use bind parameters( :P640_YEARS, :P640_EMPLOYER_ID) then the problem happens but if I hard code values all is fine (2010,99).
    This happens with every flash chart we have, which makes our application and database unusable.
    Any ideas.
    Derek

    Thanks very much for the posts, I took the opportunity to upgrade to Apex 4.0.2 as suggested by Patrick and the application works fine again now.
    Interestingly I did re-analyse the statistics but only as a reaction to the problem, should have been done regardless.
    I did consider re-writing the pipelined functions but to be honest it would have been difficult as they are extremely complex, I wasn't looking forward to the task. I have become quite a fan of pipelined functions for building flash charts, dash boards extra, its as always about tuning the sql.
    Thanks very to all
    Derek
    Edited by: 835735 on Feb 10, 2011 1:50 PM

  • Pipelined functions with spatial data

    hi,
    i've been trying to use pipelined functions (using the TABLE and CAST operators to query data from them) to retrieve large amounts of spatial data.
    i've followed the examples on metalink, and they work fine. my problem arises when i apply similar functions to query data using SDO_FILTER, i've been trying to pipe a mdsys.sdo_geometry datatype (ref cursor) into the function - returns null.
    are spatial datatypes supported for use in pipelined functions, and using the table and cast operators?
    if they are, where can i find further reading/reference on the subject?
    thanks
    santosh sewlal

    Check out http://otn.oracle.com/products/spatial/pdf/mapviewerfaq_31.pdf
    or
    You can look for a third party solution that can draw maps.
    Then you call out to this component from Forms.

  • CONTAINS clause and the ORA-29902 error.

    Hello folks,
    I am encountering the following error in APEX.
    report error:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-10825: stored query does not exist: employee
    DRG-10825: stored query does not exist: employee
    Here is the rest of the information :
    1. I have created the index on the column in question as specified here.
    bq. {color:#0000ff} CREATE INDEX{color} \\ {color:#0000ff} \\ emp_idx ON meta_eul (display_name){color} \\ {color:#0000ff} \\ indextype is ctxsys.context; \\ {color}
    2. I have created the sqe for the word as suggested [here |http://download-west.oracle.com/docs/cd/B19306_01/text.102/b14218/cqrypkg.htm#i997218]: employee
    bq. {color:#0000ff} begin{color} \\ {color:#0000ff} \\ ctx_query.store_sqe('employee', 'empl or emp');{color} \\ {color:#0000ff} \\ end;{color}
    3. When I execute the following sql in sql developer, I get results
    bq. {color:#0000ff} SELECT SCORE(1), A.DISPLAY_NAME \\ FROM meta_eul a \\ WHERE 1 =1 \\ AND CONTAINS(A.DISPLAY_NAME , 'sqe(employee)', 1)&gt; 0 \\ ORDER BY SCORE(1) \\ {color}
    4. I have the same query in #3 above as a region in my Page.
    When I execute it, I get the error that I have mentioned above.
    Any thoughts ? Is this a limitation ?
    I am on Apex version 3.0
    Regards,
    Atul

    Thanks, Roel.
    A similar option that worked out as an alternative is that I have changed the region code to :
    bq. {color:#0000ff}SELECT SCORE(1), A.DISPLAY_NAME \\     FROM meta_eul a \\     WHERE 1 =1 \\     AND CONTAINS(A.DISPLAY_NAME , 'emp or empl or employee', 1)&gt; 0 \\     ORDER BY SCORE(1) \\ {color}
    and have avoided the sqe part. This doesn't seem to have an issue in Apex.

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

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

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

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

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

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

  • ORA-01722 Error

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

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

  • ORA-01722 errors

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

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

Maybe you are looking for

  • How do I delete photos from an external hard drive before downloading to my new Mac?

    I have a Seagate FreeAgent GoFlex external hard drive that has all my photos from my old computer on it  Because there are thousands, I want to delete a bunch of them before downloading onto my new Mac.  However, when I click on the photos, they say

  • Add insert/overwrite audio like in PP

    As Audition gets more features hod-rodded from PP, why not add the insert/overwrite as well? I often need to insert audio into a project, which means pushing all the tracks in the timeline back to make way for it. This is exactly how PP does it when

  • Are there any general guidelines/algorithm to perform arc/circular motion?

    My system consists of a PC with a IEEE488.2 from NI that connects to 2 Newport MM4006 controllers, which, in turn control a high-precision stage. I would like to know if you can provide me with any guidance/algorithm to learn about programming arc/ci

  • Suggestion for new buy

    I am planning to buy a new Nokia set. Can anybody suggest me which set I should go for - my price range is around Rs 8,000 to 9,000.00. Can anybody through some light on E50 or 6233. Thanks

  • Mavericks is corrupt

    Trying to download Mavericks; it keeps saying the file is corrupt. My time machine backups are gone. What do I do?