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.

Similar Messages

  • 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

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

  • 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 &gt; 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.

  • 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

  • Ago function with two dates

    I use OBIEE and I got some difficulties with the times dimensions and the function AGO because I used two differents dates for my measure.
    My fact table:
    Ordered ||Delivered||Amount
    12/21/2008 ||1/20/2009||30000
    1/1/2009 ||2/1/2009 ||20000
    1/1/2009 ||3/1/2009 ||10000
    2/1/2009 ||2/1/2009 ||50000
    2/1/2009 ||3/1/2009 ||50000
    12/25/2009||1/15/2010||10000
    1/1/2010 ||2/1/2010 ||25000
    1/1/2010 ||3/1/2010 ||20000
    1/1/2010 ||2/1/2010 ||20000
    1/1/2010 ||3/1/2010 ||15000
    I have two Times Dimensions (Ordered Times AND Delivered Times) and one fact table. I already tried with 2 facts table and 1 time table without success too cause they not link the value for delivered and ordered
    I want to compare the delivered situation (Amount Qty) for the same ordered day last year
    I created a prompt with a date (ex.: Ordered date <=1/1/2010 AND Delivered date >=1/1/2010) and I want to compare one year ago with 1/1/2009 (Ordered Date situation…)
    I wish the results below:
    Delivered Month||Amount||Previous Amount Year Ago
    1 || 10000 || 30000
    2 || 45000 || 20000
    3 || 35000 || 10000
    I got some problem cause I had the 100 000 in my previous year (Ago) and I don’t want it because it was ordered after 1/1/2009 (Previous year). I know that the ago function concerns the Sum of Amount by Delivered Date, Year -1 ...
    Does somebody has a solution for this ? Thank you

    Hi,
    The problem is that I only know the offset values at row level, i.e., when I run my answer report some records use a certain offset value (offset1) while others use another offset value (offset2)
    The offset value can be determinate by a logical column.
    Is it possible?
    Thanks.

  • 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

  • How to call javascript function with dynamic data in display tag

    Hi,
    Iam new to pagination concept. Iam using display tag to display rows in jsp by strtus.
    I have a problem when calling the javascript function using ahref in attribute in display tag.
    <bean:define name="form1" property="EditDetails.List" id="ListDisplay"/>
    <display:table name="pageScope.ListDisplay" cellpadding="0" cellspacing="1" pagesize="10" partialList="false" size="listSize" requestURI="">
    <display:column property="poNo" href='javascript:searchEditDetails("./submitOrder.do? actionID=getMISLoadEdit&poNumberSel=<%=((com.po.bean.EditDetails)poListDisplay).getNo()%>&statusIdSelected=<%=((com.po.bean.EditDetails)ListDisplay).getStatusId()%>")'
    title="Number"/>                         
    <display:column property="strDate"title="Date" />
    <display:column property="orderValue"title="Order Value(INR)"/>
    <display:column property="stringRequestedDeliveryDate"title="Suggested Delivery Date"/>
    <display:column property="statusDescription" title="Status" />
    </display:table>
    The above code display the data in row format is working fine when I click the No It thow javascript error and its not redirecting to the other page.
    When I try this with ordinary struts its working fine the code is:
    <logic:iterate id="polist" name="Form1" property="EditDetails.List" indexId="i" type="com.bean.EditDetails">
    <tr>
    <td ><a href="javascript:searchEditDetails("./submitOrder.do?actionID=getMISLoadEdit&NumberSel=<%=((com.bean.EditDetails)polist).getNo()%>&statusIdSelected=<%=((com.bean.EditDetails)polist).getStatusId()%>")"><html:hidden name="polist" property="No" write="true" /></a>     </td>
    <td><html:hidden name="polist" property="strDate" write="true" /></td>
    <td><html:hidden name="polist" property="orderValue" write="true" /></td>
    <td><html:hidden name="polist" property="stringRequestedDeliveryDate" write="true" />     </td>
    <td><html:hidden name="polist" property="statusDescription" write="true" /></td>
    </tr>
    </logic:iterate>
    Please help me how to call javascript with dynamic data.
    Thanks in advance

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • Oracle map function  with spatial

    Hi Experts,
    I have a database10.2.0.4 in red hat 5.0. the java application at 32 bit winrow 2003 sp2 server with tocmat ISS server6.0.
    Last week, the IE or forefox broower could not display oracle map when window server updated into 2008.
    all of other oracle function works well. We do not get any error message for this event.
    Does any expert have experience for this issue?
    Thanks
    Jim

    Try looking at this as a first step http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/10g/r2/prod/datamgmt/spatial/spatial_otn.htm?cid=4553&ssid=0 that will give you a primer on getting data in and out of Oracle Spatial.  You will find lots of tutorials on the web.  There is no substitute for reading the manuals - http://docs.oracle.com/cd/E16655_01/nav/portal_7.htm#oracle_spatial_and_location_information
    I can highly recommend a book called Pro Oracle Spatial The 12c version is due out in June but the 11g version will get you started,

  • Error while calling XQuery Function with xs:date type as Argument

    Hi,
    I have follwing function in my DataService .
    declare function tns:getXXXDetail($effectiveDate as xs:date,
    $cancelDate as xs:date) as element(ns26:XXXAccount)* {
              implCode
    declare function tns:testGetXXXDetail($searchCriteria as element(ns15:locateMemberXXXDetail))
                   as element(ns26:XXXAccount)* {
    for $Account in tns:getXXXDetail($searchCriteria/ns16:accountTypeDates/ns18:effectiveDate,
         $searchCriteria/ns16:accountTypeDates/ns18:cancelDate)
    return $Account
    I am trying to test the getXXXDetail() function from testGetXXXDetail .
    The searchCriteria is a complex type with date elements effectiveDate and cancelDate, both are optional
    When i test with effectiveDate,cancelDate elements present in $searchCriteria its working fine.
    When i remove these dates element i am getting follwing error
    "expected exactly one item, got 0 items" error
    Any Clue ?

    When i remove these dates element i am getting follwing error"expected exactly one item, got 0 items" error
    Sounds like your schema for these items indicates minOccurs="1" (or relies on that as the default).
    Edit the schema and change the definitions to be...
    <xs:element name="effectiveDate" minOccurs="0" ... />

  • Error while executing planning function with reference data

    Hi,
    I have a two planning functions one is used to upload the file (with out reference data checkbox in planning function RSPLF1) and other planning function ('Referece data'check box is selected in custom planning function RSPLF1) to execute the logic of creating new record along with the flat file data.
    Following data is uplooaded
    Company code | Profit_ctr | calmonth | Amount
    1000                 | 50000      | 01.2011  | 150
    Cube data
    Field1    |  Company code | Profit_ctr | calmonth | Amount
             |  1000                 | 50000      | 01.2011  | 150
    Z1         |  1000                 | 50000      | 01.2011  | 150
    Now I want to change the value from 150 to 200 and when I try to execute with the following data, it is giving dump 'a row with the same key already exists'.
    Company code | Profit_ctr | calmonth | Amount
    1000             | 50000          | 01.2011  | 200
    Ideally in the second execution it should append the new row with Amount value 50 to cube which is the delta value.
    I debugged the issue and found that I_TH_REF_DATA has following data and C_TH_DATA also contains the same records.
    Field1     Company code | Profit_ctr | calmonth | Amount
    #     1000                 | 50000      | 01.2011  | 150
    Z1     1000                 | 50000      | 01.2011  | -150
    Z1     1000                 | 50000      | 01.2011  | 150
    Due to this, record which already exists in C_TH_DATA and trying to append new record with the same combination is failing.
    C_TH_DATA should only contain the source data of Amount 200, but not sure why reference data is coming in C_TH_DATA.
    Could anyone please guide me on how the reference data is getting populated in C_TH_DATA ?
    Thanks in advance
    Edited by: peppy on Aug 3, 2011 5:00 PM
    Edited by: peppy on Aug 3, 2011 8:37 PM

    Hi Peppy,
    C_TH_DATA is hashed table!  According to your post you are trying to append to C_TH_DATA and this results in a dump. Please take a look at the standard planning function to see how SAP is programming the planning functions. E.g. in CL_RSPLFC_REPOST method IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE you can find the following code:
      CREATE DATA l_r_data_wa LIKE LINE OF c_th_data.
      ASSIGN l_r_data_wa->* TO <s_data_wa>.
      CREATE DATA l_r_new_wa LIKE LINE OF c_th_data.
      ASSIGN l_r_new_wa->* TO <s_new_wa>.
    LOOP AT c_th_data INTO <s_data_wa>.
    <s_new_wa> = <s_data_wa>.
    now the SAP code changes the  values, you can do it your way here
    and than write the changes back
            MODIFY TABLE c_th_data FROM <s_data_wa>.
    ENDLOOP:
    Another option is to use the READ statement to check if the record is already in the table. If not, you can use MODIFY otherwise you use INSERT. So you get something like this:
    READ C_TH_DATA from <s_data_wa> transporting no fields.
    if not sy-subrc EQ 0.
      INSERT <s_data_wa> into table C_TH_DATA.
    else.
      MODIFY TABLE c_th_data FROM <s_data_wa>.
    endif.
    Depending on your requirements you can also use the collect  statement.
    If c_th_data shows the reference data as well, you may need to adjust the filter to restrict it to the correct values.
    Hope this helps.
    Best regards
    Matthias Nutt
    SAP Consulting Switzerland

  • Crystal 2013 is casting a function with a date result as a string result, sometimes??

    I have an SQL Server function to take a JDEdwards numeric date and convert it to an SQL Date field. 
    CREATE FUNCTION [dbo].[date_ccyyddd_to_mmddyyyy]
      @JulianDate as Numeric(18,0)
    RETURNS Date
    AS
    BEGIN
    Declare @ResultDate as Date
    Set @ResultDate = DATEADD(YEAR, @JulianDate / 1000 + 1899, Cast('01/01/0001' as Date))
    Set @ResultDate = DATEADD(Day, @JulianDate % 1000 -1, @ResultDate)
    RETURN @ResultDate
    END
    In many query based reports we have used the function.  It works quite nicely for all but one user.  For this one user Crystal is casting the date result as a string, it will then display as a yyyy-mm-dd format instead of his default mm/dd/yyyy short date format.  It would generally be ok but since it is typed as a string if the user exports the results to excel it is not recognizing the column as a date either.  The strange piece of the equation is that if the user saves the report to the enterprise server and I open it, go to edit the SQL command, do nothing, close the edit box, it gives me the unmapped fields wizard where I can fix the report.  Thus when I open or generate a new report with this function it "knows" the result is a date but with a specific user it sees the result as a string.
    Has anyone had a similar situation or can lead me in the correct direction to fix this?  Unfortunately, this user is our power user, he writes more reports than anyone else.  It appeared as a problem when we upgraded from Crystal Enterprise 2008 to 2013.
    Current work around for user is to use a crystal CDate() function on the report side but I would like to get the correct solution.
    Any assistance appreciated,

    To add to Dell's suggestion:
    If OLE DB then use:
    MS SQL 2005 - OLE DB Provider
    MS SQL 2008 - SQL Native 10
    MS SQL 2012 - SQL Native 11
    MS SQL 2013 - SQL Native 11
    If ODBC then use:
    MS SQL 2005 - SQL Native
    MS SQL 2008 - SQL Native 10
    MS SQL 2012 - SQL Native 11
    MS SQL 2013 - SQL Native 11
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Pipelined Function with dynamic query

    Hello All,
    Orcl Ver: 11g R2.
    I am leveraging the Oracle's pipelined table function.
    It's working fine for static SQL.
    create or replace package test13_pkg as
        type r_disc_req is record(disc_line_id number,
                                 req_id number);
        type t_disc_req is table of r_disc_req;
        function F_GetDiscReq return t_disc_req pipelined;
        procedure P_ProcessDiscReq;
    end;
    CREATE OR REPLACE PACKAGE BODY test13_pkg
    AS
       FUNCTION F_GetDiscReq
          RETURN t_disc_req
          PIPELINED
       IS
          lo_disc_req   r_disc_req;
       BEGIN
          FOR r_row IN (SELECT disc_line_id, req_id
                          FROM edms_disc_lines_stg
                         WHERE ROWNUM < 10)
          LOOP
             lo_disc_req.disc_line_id := r_row.disc_line_id;
             lo_disc_req.req_id := r_row.req_id;
             PIPE ROW (lo_disc_req);
          END LOOP;
       END F_GetDiscReq;
       PROCEDURE P_ProcessDiscReq
       AS
          ln_totalRecords   NUMBER;
       BEGIN
          SELECT COUNT (*)
            INTO ln_totalRecords
            FROM edms_disc_lines_stg t1, TABLE (F_GetDiscReq ()) t2
           WHERE t1.disc_line_id = t2.disc_line_id AND t1.req_id = t2.req_id;
       DBMS_OUTPUT.put_line (ln_totalRecords);
       END;
    END;
    begin
        test13_pkg.P_ProcessDiscReq();
    end;
    How do I leverage it for dynamic sql?
    FUNCTION F_GetDiscReq (p_filter1 IN NUMBER, p_filter2 IN NUMBER, p_filter3 IN NUMBER)
       RETURN t_disc_req
       PIPELINED
    IS
       lo_disc_req   r_disc_req;
       l_sql varchar2(4000) := 'SELECT disc_line_id, req_id
                       FROM edms_disc_lines_stg';
       l_where_clause varchar2(4000) := 'WHERE 1 = 1 ';
    BEGIN
       IF p_filter1 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = '||p_filter1;
       END IF;
       IF p_filter2 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = '||p_filter2;
       END IF;
       IF p_filter3 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = '||p_filter3;
       END IF;
       l_sql := l_sql||l_where_clause;
    --I'm stuck here.   
    FOR r_row IN (l_sql)
       LOOP
          lo_disc_req.disc_line_id := r_row.disc_line_id;
          lo_disc_req.req_id := r_row.req_id;
          PIPE ROW (lo_disc_req);
       END LOOP;
    END F_GetDiscReq;
    Could you please guide me here?
    Thx
    Shank.

    Hi,
    It's very doubtful whether you need or want dynamic SQL for this task.
    If you do, however, here's one way to do it:
    FUNCTION F_GetDiscReq
    (  p_filter1  IN  edms_disc_lines_stg.filter1%TYPE
    ,  p_filter2  IN  edms_disc_lines_stg.filter1%TYPE
    ,  p_filter3  IN  edms_disc_lines_stg.filter1%TYPE
       RETURN t_disc_req
       PIPELINED
    IS
       lo_disc_req   r_disc_req;
       l_sql varchar2(4000) := 'SELECT disc_line_id, req_id
                       FROM edms_disc_lines_stg ';
       l_where_clause varchar2(4000) := 'WHERE 1 = 1 ';
       c     SYS_REFCURSOR;
    BEGIN
       IF p_filter1 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = ''' || p_filter1 || '''';
       END IF;
       IF p_filter2 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter2 = ''' || p_filter2 || '''';
       END IF;
       IF p_filter3 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter3 = ''' || p_filter3 || '''';
       END IF;
       l_sql := l_sql||l_where_clause;
    --   dbms_output.put_line (l_sql || ' = l_sql');   -- For debugging
       OPEN  c  FOR l_sql;
       LOOP
          FETCH  c  INTO  lo_disc_req;
          EXIT WHEN  c%NOTFOUND;
          PIPE ROW (lo_disc_req);
       END LOOP;
    END F_GetDiscReq;
    Static SQL will, in general, be more efficient than dynamic SQL.
    Given that you need dynamic SQL, there are lots of ways the function above could be made more efficient.  If that's an issue, make sure you understand what this is doing before trying to improve it.

  • Turning sql  string (with dynamic columns) into a pipelined function

    Hi guys,
    I was working on an apex report the other day, and wrote the sql below (for those who don't know apex well, in an apex report you can define the columns at runtime.) When I was finished, I said to myself: "It would be great to have a pipeline function with this capability." So, the idea would be to have a sql string where the columns are created dynamically, depending on input parameters - and then be able to use this sql everywhere (oracle reports, sqlplus) through a pipelined function.
    Here's the sql (simplified, of course, the data itself is actually not important - the LOOP is the key)
    declare
    v_sql varchar2(4000);
    begin
    v_sql := 'select client, ';
    for i in (select employee from company_employees_view where condition = pi_parameter order by 1) loop
    v_sql := v_sql || sum(decode(employee,''' || i.employee || ''', total)) "' || i.employee || '"';
    end loop;
    v_sql := v_sql || ', sum(total) "Total"';
    v_sql := v_sql || ' from company_employees_view group by client';
    end;
    This sql would result in a final product like:
    select client
    , sum(decode(employee,'John',total) "John"
    , sum(decode(employee,'Paul',total) "Paul"
    , sum(decode(employee,'George',total) "George"
    (and so on... this sql could have more or less columns depending on the input parameters of the function)
    from company_employees_view
    group by client;
    I have tried feeding this sql into a ref cursor and an object, but always received an "inconsistent datatypes" message.
    The object would be something like:
    create or replace object rt_employee as (total number);
    create or replace tt_employee as table of rt_employee;
    create or replace object rt_client as (
    client varchar2(100),
    employee tt_employee);
    create or replace tt_client as table of rt_client;
    (I am not paying too much attention to syntax here.)
    By the way, no hurry whatsoever, this is just for fun, take your time. I am using database XE with apex 2.1 and sql developer 1.2.
    Thanks, Roger

    This is the only solution I've ever seen to dynamic pipelined columns...
    How to pipeline a function with a dynamic number of columns?

Maybe you are looking for