Map Viewer Query Rewriting for Dynamic themes and  Materialized Views.

Hi,
I am usng a WMS request to render FOI points in my map.
Internally query rewrite is happening in Mapviewer for this dynamic theme and my data points query is getting converted as
select FROM
( select status, shape from MatView.MyTab where id = '3' )
WHERE MDSYS.SDO_FILTER(shape, MDSYS.SDO_GEOMETRY(2003, 4283, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(144.948120117188,-37.8162934802451,144.950866699219,-37.8141237016045)), 'querytype=WINDOW') = 'TRUE'
here the rewritten query is not correct and is throwing exceptions in mapviewer log
How can I make this query to be written correctly.
(My orginal query before rewrite is: select status,shape from MatView.MyTab where id='3' )
I am using a materialised view : MatView is a materialized view.
When I used normal tables, the query is re written correctly.But for this materialized view this is happening.
How can I correct the error?
Is this has something to do with some Spatial Indexing in Materialised view or Query Rewriting for materialized view?
Edited by: 841309 on Mar 10, 2011 11:04 PM

Oops!
The Materialized view was not accessible from the schema I tried :)
And so when I gave permissions,it formed the correct query.
So if permission is not there,map viewer will rewrite the query in a wrong way! New information.

Similar Messages

  • How do u use SDO_RELATE for dynamic theme

    Hi ,
    I have line geometry. For this line geometry I have to create a buffer using SDO_GEOM.SDO_BUFFER and I have to check whether the given point geometry is with in this buffer.
    How can i do it?
    i have used buffer and SDO_RELATE but its giving error as
    "SDO_RELATE can not be used with out Spatial Index". Here my buffer is a dynamic theme.
    Is there any possibility to create index for dynamic theme?
    Thanks and Regards
    Aravindan

    Hello
    We did something familiar in a sence.
    We used an analysis based sdo_NN.
    Also therefor the spatial index is required and used.
    We created a Materialized view containing the sdo_buffered result geometry, based on additional where clauses for the base table..
    We defined a spatial index on the materialized view result table, and an additional view containing the sdo_nn operator to this materialized view result table.
    So when we changed the requirements in which geometry had to be buffered in the first step, we refreshed to materialized view. This caused the de sdo_index being updated. this way the view with the operator was actualized.
    I hope this explained a little bit the way we did this, maybe this can help you out.
    Luc

  • Different Pricing Schema in PO and PIR for same vendor and material

    Dear Experts,
    I am facing an issue related to MM.
    I have a vendor and a material under a plant, purchase Org, purchase group.
    When we are creating a Purchase Info Record (PIR), it is picking one pricing schema, while when creating PO for same vendor and material, it is picking another different pricing schema.
    As per my knowledge, pricing schema in PO is picked as per pricing schema group of Vendor and I believe same applies for PIR as well. I have only one vendor pricing schema group.
    Because of this issue, I have to manually key-in condition values in PO for all condition types even though I have maintained a purchase info record.
    Please suggest, what can be reason.
    Regards,
    Praveen

    Hi,
    Thanks for clearing my doubts.
    However, I stuck-up in another issue.
    Problem is that condition type- PB00 is linked with almost all pricing schemas.
    Hence, I can't change pricing procedure  in condition type- PB00.
    Also, I can't include all J* related condition types in RM0002 as well.
    Hence, if PB00 remains as RM0002 and I maintain my pricing procedure- ZJIMPO to all J* condition types, still I am not able to create PIR for all J* conditions. Error "Condition type J1CV is not in procedure A M RM0002".
    How to handle this issue? Please suggest.
    Thanks
    Praveen

  • Query rewrite for COUNT(DISTINCT)

    Hi,
    I am having fact table with different dimension keys.
    CREATE TABLE FACT
    TIME_SKEY NUMBER
    REGION_SKEY NUMBER,
    AC_SKEY NUMBER
    I need to take COUNT(DISTINCT(AC_SKEY) for TIME_SKEY and REGION_SKEY. There are oracle dimension defined for time and region which are using TIME_SKEY and REGION_SKEY. I have created MV with query rewrite with COUNT(DISTINCT) but it is not using dimension if I am using any other level and MV can't be fast refreshed as it was build using COUNT(DISTINCT).
    CREATE MATERIALIZED VIEW AC_MV
    NOCACHE
    NOLOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH COMPLETE ON DEMAND
    WITH PRIMARY KEY
    ENABLE QUERY REWRITE
    AS
    SELECT
    TIME_SKEY ,
    REGION_SKEY,
    COUNT (DISTINCTAC_SKEY)
    FROM FACT
    GROUP BY TIME_SKEY, REGION_SKEY;
    Query used to retrieve data is as below
    SELECT TIME_SKEY, COUNT(DISTINCT AC_SKEY) OVER (PARTITION BY TIME_SKEY) UNIQ_AC, COUNT(DISTINCT AC_SKEY) OVER () UNIQ_AC1
    FROM FACT;
    There can be other queries based on time / region dimension.
    Can you please provide help in solving above issue?
    Thanks,
    Pritesh

    What version of the Oracle database?

  • Is there a solution for dynamic reports and using Denes' Export to Excel?

    Oracle 10.2.0.4.0
    Application Express 3.2.1.00.10
    Hello all!
    I am using Denes Kubicek's Export_Excel_Pkg in my application and I'm having trouble exporting reports based on report regions created using a PL/SQL function body returning SQL query. I realize this is not an Oracle supported package, but was hoping someone here could shed some light on it. When I open up the Excel file, I get an error such as: Report Values Error: ORA-06550: line 22, column 5: PL/SQL: ORA-00907: missing right parenthesis.
    I've searched the forum and already have done as others suggested by modifying the REPLACE on the v_sql variable in Export_Excel_Pkg.Get_Usable_SQL, but it did not work. My assumption is that there is an issue with the value being passed to the wwv_flow_utilities.get_binds function. I could not find documentation on this function, but I'm thinking that it cannot extract the bind variables within a PL/SQL block. The report only works when I have just use SQL with bind variables...doesn't work for PL/SQL. Nor does it work for dynamic SQL reports that use a "lexical" parameter (e.g. using WHERE &p_and_condition.) to build the WHERE clause.
    Has anyone come up with a work-around to this? I somehow need to be able to extract reports based on dynamic SQL (or PL/SQL) to Excel.
    Help is appreciated!
    This is my example of a report based on PL/SQL function:
    DECLARE
      v_sql VARCHAR2(4000);
    BEGIN
      v_sql := q'[SELECT UPPER(t1.olo_name) agency_title,
           t1.class_code,
           UPPER(t1.class_title) class_title,
           t1.pay_plan,
           t1.pay_grade_code,
           COUNT(t1.appt_fte) total_employees,
           SUM(t1.appt_fte) filled_fte,
           AVG(DECODE(t2.pay_cycle_code,
                      'UB',((t1.wage_type1_amt_for_pay * 26)/t1.appt_fte),
                      'UM',((t1.wage_type1_amt_for_pay * 12)/t1.appt_fte),
                       0)) avg_annual_rate
       FROM my_schema.table1 t1,
                my_schema.table2 t2,
                my_schema.table3 pro
      WHERE t1.pos_wk = t2.pos_wk
        AND t2.pos_rate_active_flag = 'Y'
        AND t1.ops_ind = 'N'
        AND t1.employee_type IN ('1','2')
        AND pro.ROLE_CODE = :F101_DW_ROLE
        AND pro.pos_role_orgs_active_flag = 'Y']';
      IF :P_MULTI_OLO IS NOT NULL THEN
        v_sql := v_sql || q'[ AND INSTR(':'||']' || v('P_MULTI_OLO') || q'['||':', ':'||t1.olo_code||':') > 0]';     
      END IF;
      v_sql := v_sql || q'[GROUP BY UPPER(t1.olo_name), t1.class_code, UPPER(t1.class_title), t1.pay_plan, t1.pay_grade_code ORDER BY t1.class_code ASC, avg_annual_rate]';
      RETURN v_sql;
    END;This is my example using a SQL statement with a lexical parameter:
    SELECT UPPER(t1.olo_name) agency_title,
           t1.class_code,
           UPPER(t1.class_title) class_title,
           t1.pay_plan,
           t1.pay_grade_code,
           COUNT(t1.appt_fte) total_employees,
           SUM(t1.appt_fte) filled_fte,
           AVG(DECODE(t2.pay_cycle_code,
                      'UB',((t1.wage_type1_amt_for_pay * 26)/t1.appt_fte),
                      'UM',((t1.wage_type1_amt_for_pay * 12)/t1.appt_fte),
                       0)) avg_annual_rate
       FROM my_schema.table1 t1,
                my_schema.table2 t2,
                my_schema.table3 pro
      WHERE t1.pos_wk = t2.pos_wk
        AND t2.pos_rate_active_flag = 'Y'
        AND t1.ops_ind = 'N'
        AND t1.employee_type IN ('1','2')
        AND pro.ROLE_CODE = :F101_DW_ROLE
        AND pro.pos_role_orgs_active_flag = 'Y'
        &P63_AND_CONDITION.
      GROUP BY UPPER(t1.olo_name),
               t1.class_code,
               UPPER(t1.class_title),
               t1.pay_plan,
               t1.pay_grade_code   
    ORDER BY t1.class_code ASC, avg_annual_rateThe *&P63_AND_CONDITION.* value is populated based on a "Before Header" computation under Page Rendering, using the logic below. It is then used by the SQL query defined in the reports region at run time.
    DECLARE
      v_sql VARCHAR2(4000) := NULL;
    BEGIN
      v_sql := ' ';
      IF :P_MULTI_OLO IS NOT NULL THEN
        v_sql := v_sql || q'[ AND INSTR(':'||']' || v('P_MULTI_OLO') || q'['||':', ':' || t1.olo_code || ':') > 0]';     
      END IF;
      RETURN v_sql;
    END;

    Did you get an answer for this?

  • PCI-6542 card for dynamic genration and static control

    Hello
    I am using only one PCI -6542 card. I want to use few channels for dynamic signal. These are control signals for the ADC. While the conversion is in progress I want to use remaining signals for switching relays for measurement.
    Application requirements are as follows.
    Channel 0-14 are for dynamic genration for giving control signal to ADC.
    Channel 15-31 are for static control bits for relays.
    Requirement is pattern should be running continiously and parallely I shoud able to switch the ralay. It can be in any order and any seqence as per the demand.
    Thanks and Reards
    Amol

    Hello
    I can able to solve this problem. For your referance I have attached here the code. Which works for this.
    Thanks and Regards
    Amol
    Attachments:
    application.vi ‏65 KB

  • Table and Field for Open Order Quantity for a Customer and Material

    Hi
    I created two sales orders 3 and 5 quantities, and delivered 1 qty in the second order.
    when I checked the table VBBE or VA05, I am able to see 3 and 4 qantities open.
    but I want to see the total 7 as open order qty, i.e, 3+4=7
    because both the orders are placed by the same customer and same material
    can u please tell me in which table exactly the total open order quantity for a customer and total open order quantity for a material is stored
    Madhu
    Edited by: madhubabu rao on Jul 1, 2008 1:49 PM

    HI,
    U can get the information in VA05 as there are columns like confirmed quantity and order quantty and status. U can use  summation button (add upto values) to get required information.
    Thx,
    Pramod

  • How to  find the Open sale orders till date for  given plant and material ?

    Hi experts,
                     I have a requirement to calculate the open sale orders for a given plant and material. I have tried in VA05 wherein i can get only for the material and sales area combination. From the document nos obtained from VA05 i can then find the plant. But my question is how do i get the output of VA05 into my progra. (can i use submit for a module pool report ).
    Also if ther is some other standard table or Function module to find the open sale orders till a given date ,it will be even more helpful....in which case i can drop the VA05 route.
    Kindly help
    Thanks in advance
    Ashwin

    Hi Ashwin,
        You can use SAP Tables VBAK and VBUP to get to know if the document is complete or not.
       VBUK-GBSTK is the field that will give you the status of the Sales Order .
      VBUK is used at header level , whereas VBUP is used for Item level.
      So in your case what I would do is :
      Get the Sales Orders that satisy the plant and material criteria from VBAP table , take this Sales Document numbers and go to VBUK or VBUP table to get the Sales Order Status. 
       If I need to find the open quantity as well I will link to VBFA table based on the document number.
      Reward if helpful.
    Thanks,
    Imran

  • ADF Query Panel for Dynamic VO.

    Hi All,
    i am using jdev version 11.1.1.5.0.
    In my use case i have created one dynamic VO because table and no of column decided run time. now i want to provide filter on that vo using Named view criteria as ADF query panel.
    but column and table decided run time. So can i create dynamic query panel(View Criteria) run time?
    or Is there any another way to achieve my requirement?
    Thanks in Advance.

    Hi Manish,
    not sure if this is what you are looking for, but you can have dynamic viewcriteria in a search region.
    In the searchregion binding in the pageDefenition simply use an EL Expression to determine what criteria to use.
    <searchRegion Criteria="#{pageFlowScope.startupMode eq 'mgr' ? 'CriteriaForManager' : 'CriteriaForEmployee'}"               
                         Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"               
                         Binds="EmployeesView1Iterator"                
                         id="CriteriaForManagerQuery"/>  I explained it on my weblog : http://lucbors.blogspot.nl/2011/10/in-my-current-project-use-lot-of-re.html
    Good luck,
    Luc

  • Refreshing query data for Dynamic Page Generator

    Can anyone tell me why I must exit out of XMII and re-login in order to have any updates saved in either a Data Query or Display Query show up when I use the Dynamic Page Generator.
    I attended the Xmii beginner level training.  In the training, I could hold the Ctrl key and click the Refresh button on my browser to update the templates.
    Thanks
    Mike

    Mike,
    The reason for this was that the machines that were used in training had Java SDK 1.5 installed if you are using 1.4 you cannot hold down the ctrl key to refresh the cache you must go into Tools -> Sun Java Console -> click the "X" key and that will clear the cache.
    Erik

  • Query AD for DLL's and the last accessed date

    Hi,
    We are trying to clean up stale DLL's that are not being used.  Does anyone have a LDAP query for AD that can list all DLL's and the last date it was accessed

    Hello,
    I'd ask in the
    Directory Services forum, but as Dave says, I don't think that AD will have this information
    If you are running Exchange, you can check the transport logs for event ID Expand, and depending on how long you keep your logs, the "RelatedRecipientAddress" will be the group name, and the "Timestamp" will be the time used.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Query Syntax for Dynamic Navigation Menu

    I'm trying to build a Navigation menu from a query using the following syntax:
    select LEVEL,
           LABEL,
           LINK,
           'NO' as IS_CURRENT,
           null as IMAGE
      from V$RC_MENUS
    where CLUB = :APP_CLUB
    start with PID is null
    connect by prior ID = PID
    order by SEQUENCE, LABEL
    The query itself works fine for all values of APP_CLUB but it only generates the menu entries for some values of APP_CLUB, but not others. The SEQUENCE value determines the order of the entries within each level. Is this the correct syntax for a query-based navigation menu? How does it determine which sub-levels belong to a parent?  Does the ordering of the resultset have any impact on how the menu is generated?

    Jritschel-Oracle wrote:
    I'm trying to build a Navigation menu from a query using the following syntax:
    select LEVEL, 
          LABEL, 
          LINK, 
          'NO' as IS_CURRENT, 
          null as IMAGE 
      from V$RC_MENUS 
    where CLUB = :APP_CLUB 
    start with PID is null 
    connect by prior ID = PID 
    order by SEQUENCE, LABEL 
    The query itself works fine for all values of APP_CLUB but it only generates the menu entries for some values of APP_CLUB, but not others. The SEQUENCE value determines the order of the entries within each level. Is this the correct syntax for a query-based navigation menu? How does it determine which sub-levels belong to a parent?  Does the ordering of the resultset have any impact on how the menu is generated?
    As stated in the documentation:
    ...do not specify either ORDER BY or GROUP BY, because they will destroy the hierarchical order of the CONNECT BY results. If you want to order rows of siblings of the same parent, then use the ORDER SIBLINGS BY clause.
    Try:
    select LEVEL,
          LABEL,
          LINK,
          'NO' as IS_CURRENT,
          null as IMAGE
      from V$RC_MENUS
    where CLUB = :APP_CLUB
    start with PID is null
    connect by prior ID = PID
    order siblings by SEQUENCE, LABEL

  • Map BATCH number corresponding to ORDER number and Material number .

    hi all,
    i want to map the BATCH number corresponding to Material Number .
    i searched tables MCHA which has two fields Material number and Batch number but it doenot have Order number.
    so how can i get Batch number as in table AFPO/AFKO i have all these three fields batch/material/order numbers.
    but the batch number column is blank for all .
    and in case of table MCHA , these is assigned batch number to every Material number .
    also i want to ask , either the Material number in both tables (MCHA AND AFPO) is same or different as i didnot found any relation to map these three field by other fields too.
    so please suggest me the Possible way to resolve this .....
    sunny

    hi dsk,
    thanks for your earliar reply,
    actually iam working on sapscript there i want to add batch number ,but i am not able to clear my doubt from where i get this.
    how can i map batch number with corresponding to PO num ber, '
    in the report i used structure vbplp with field charg"(batch num).
    also i want to know from which table i can get customer part number and Po number .
    how can i add batch num ,..
    from which table or with which field i can compare itr to get .
    sunny

  • How to disable delivering plant for sales organisation and material

    HI
    We usually deliver via 2 delivering plants and changing them via MM02 according to availability Theese 2 delivering plants are connected  with many sales organisations
    It  is possible to disable delivering plant for some products to specific sales organisation , so that customer service is not able to order a this material from a plant for this sales organisation? Other sales organisation should be still able to order the product  from that plant.
    I can imagine to block the whole delivering plant for a material. But how is possible to do so on the level of sales organisarion-material-plant?
    Thanks a lot
    Sona

    With standard, it is not possible.  You can try with USEREXIT_CHECK_VBAP in the program MV45AFZB
    G. Lakshmipathi

  • SAP report for movement type and material type

    Hi!
    I would like to use a standard SAP report to give me a list of all the movement types (much like MB51) but instead of material I would like to select on Material type e.g. ROH. The result should for example be a list of the movement types 501 on material type ROH.
    It is urgent, if you could help me I would be very greatful!
    Sincerely
    Anders Öhrling

    Thanks for your answer!
    I have managed to join the two tables and created a report that will work, except that the amounts in local currency that is given by movement type 201 is not negative (as in MB51). I need all movement types that generate a debit must be shown as a negative value. Wo when I summarize all the movement types I end up with the value of 101 minus 201.
    Is that possible without ABAP programming?
    Sincerely Anders Öhrling

Maybe you are looking for