Query based on two views

Hello ppl, I need your help.
I got this query which is based on two views.
View_1: x1, x2, x3, x4, day, xy
View_2: y1, y2, y3, y4, day, xy
By running a SELECT query on each view takes approx 2 minutes, yes there are lots of records.
When I combine the query most of the time it times out. I think there is something wrong with my query.
View_1 = View_2 on col xy and day, however I have to get the records from View_2 for the following day, i.e if day = 3 from View_1 and the record from View_2 should be coming from view_2
at present my query is like this
SELECT a.x1, a.x2, a.x3, a.x4, a.day, a.xy, b.y1, b.y2
FROM view_1 a, view_2 b
WHERE b.y2= 100
AND a.xy = b.xy
AND b.y1 = ( SELECT b.y1
FROM view_1 a, view_2 b
WHERE b.day = a.day + 1)
ORDER BY a.x1
This query gets called in a coldfusion page.
P.S I can also ask the DBA to make me a new view based on the same columns as the query. Would that help with speed?

I don't see any reason why my query shouldn't give
you what you desire.
View_1
x1     x2     x3     x4     Day     XY
2      3      23      32      3      2132
3      3      2      3      4      2132
4      3      43      32      5      2132
View_2
y1     y2     y3     y4     Day     XY
4      100      13      32      3      2132
5      100      4      3      4      2132
7      100      43      32      5      2132
5      100      23      12      6      2132
Is it a coincidence that XY has the same value in your sample? Could it be different
and at the same time participate in the desired result?
SELECT     a.x1, a.x2, a.x3, a.x4, a.day, a.xy, b.y1, b.y2
FROM     view_1 a
,     view_2 b
WHERE     b.y2 = 100
AND     a.xy = b.xy
AND     b.day = a.day + 1
ORDER BY a.x1
>
X1     X2     X3     X4     Day     XY     y1     y2
2      3      23     32      3      2132      5      100
3      3      2      3      4      2132      7      100
4      3      43     32      5      2132      5      100
According to the reply to my question above, it can be ok or not.
That is why I proposd this (in case the reply were yes):
SELECT a.x1, a.x2, a.x3, a.x4, a.day, a.xy, b.y1, b.y2
FROM view_1 a, view_2 b, vew_1 c
WHERE b.y2= 100
AND a.xy = b.xy
AND b.day = c.day + 1
ORDER BY a.x1

Similar Messages

  • How can I use a single query panel with two view criteria?

    Hi all,
    I have a requirement to allow users to change the "display mode" on a search results tree table for an advanced search page. What this will do is change the structure of how the data is laid out. In one case the tree table is 3 levels deep, in the other case it's only 2 with different data being at the root node.
    What I've done so far:
    1) I exposed the data relationship for these two ways of viewing the data in the application module's data model.
    2)  I created a view criteria in the two view objects that are at the root of the relationships, where (for simplicity sake) I'm only comparing a single field.
    This is in one view object:
    <ViewCriteria
        Name="PartsVOCriteria"
        ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartsVO"
        Conjunction="AND">
        <Properties>... </Properties>
        <ViewCriteriaRow
          Name="vcrow23"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="PartDiscrepantItemsWithIRVO"
            ViewAttribute="PartDiscrepantItemsWithIRVO"
            Operator="EXISTS"
            Conjunction="AND"
            IsNestedCriteria="true"
            Required="Optional">
            <ViewCriteria
              Name="PartDiscrepantItemsWithIRVONestedCriteria"
              ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartDiscrepantItemsWithIRVO"
              Conjunction="AND">
              <ViewCriteriaRow
                Name="vcrow26"
                UpperColumns="1">
                <ViewCriteriaItem
                  Name="InspectionRecordNumber"
                  ViewAttribute="InspectionRecordNumber"
                  Operator="="
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
              </ViewCriteriaRow>
            </ViewCriteria>
          </ViewCriteriaItem>
        </ViewCriteriaRow>
      </ViewCriteria>
    and this is in the other view object:
    <ViewCriteria
          Name="IRSearchCriteria"
          ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.InspectionRecordVO"
          Conjunction="AND">
          <Properties>... </Properties>
          <ViewCriteriaRow
             Name="vcrow7"
             UpperColumns="1">
             <ViewCriteriaItem
                Name="InspectionRecordNumber"
                ViewAttribute="InspectionRecordNumber"
                Operator="="
                Conjunction="AND"
                Required="Optional"/>
          </ViewCriteriaRow>
       </ViewCriteria>
    3) I had a query panel and tree table auto-generated by dragging the data control for ONE of the view object data relationship that's exposed in the app module. Then I created a second query panel and tree table the same way but using the data control for the other. I'm hiding one of the query panels permanently and toggling the visibility of the tree tables based on the display mode the user chooses. Both tables have separate bindings and iterators.
    This is a portion of the page definition:
    <executables>
        <variableIterator id="variables"/>
        <searchRegion Criteria="IRSearchCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="InspectionRecordVOIterator"
                      id="IRSearchCriteriaQuery"/>
        <iterator Binds="InspectionRecordVO" RangeSize="25"
                  DataControl="QARS_AppModuleDataControl"
                  id="InspectionRecordVOIterator" ChangeEventPolicy="ppr"/>
        <iterator Binds="Root.QARS_AppModule.PartsVO1"
                  DataControl="QarsMasterAppModuleDataControl" RangeSize="25"
                  id="PartsVO1Iterator"/>
        <searchRegion Criteria="PartsVOCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="PartsVO1Iterator" id="PartsVOCriteriaQuery"/>
      </executables>
    4) I've created a custom queryListener to delegate the query event.
    This is in my advanced search jsp page:
    <af:query id="qryId1" headerText="Search" disclosed="true"
                      value="#{bindings.IRSearchCriteriaQuery.queryDescriptor}"
                      model="#{bindings.IRSearchCriteriaQuery.queryModel}"
                      queryListener="#{pageFlowScope.SearchBean.doSearch}"
                      queryOperationListener="#{bindings.IRSearchCriteriaQuery.processQueryOperation}"
                      resultComponentId="::resId2" maxColumns="1"
                      displayMode="compact" type="stretch"/>
    This is in my backing bean:
    public void doSearch(QueryEvent queryEvent) {
          String bindingName = flag
             ? "#{bindings.IRSearchCriteriaQuery.processQuery}"
             : "#{bindings.PartsVOCriteriaQuery.processQuery}";
          invokeMethodExpression(bindingName, queryEvent);
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext fctx = FacesContext.getCurrentInstance();
          ELContext elContext = fctx.getELContext();
          ExpressionFactory eFactory = fctx.getApplication().getExpressionFactory();
          MethodExpression mexpr =
             eFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
          mexpr.invoke(elContext, new Object[] { queryEvent });
    When no inspection record number (the only search field so far)  is supplied in the query panel, then it behaves correctly. Namely, the tree tables shows all search results. However, when an inspection record number is supplied the tree table that was created with the query panel in use (remember there are two query panels, one of them is hidden) shows a single result (this is correct) while the other tree table (the one with the hidden query panel that isn't in use) shows all results (this is NOT correct).
    Is what I'm trying to accomplish even doable? If so, what am I missing?
    I'm using JDeveloper 11.1.1.7
    Thanks,
    Bill

    I ended up keeping one query panel permanently visible and the other permanently hidden. When performing a search using the table that has the hidden query panel, I seed the query descriptor for the hidden query panel using the visible query panel's query descriptor and then delegate the request:
       public void doSearch(QueryEvent queryEvent) {
          String bindingName = null;
          if(isIrTableRendered()) {
             bindingName = "#{bindings.IRSearchCriteriaQuery.processQuery}";
          } else {
             seedPartsQueryDescriptor();
             bindingName = "#{bindings.PartsVOCriteriaQuery.processQuery}";
             queryEvent = new QueryEvent(partsQuery, partsQuery.getValue());
          invokeMethodExpression(bindingName, queryEvent);
       private void seedPartsQueryDescriptor() {
          ConjunctionCriterion criterion = irQuery.getValue().getConjunctionCriterion(); 
          for(Criterion criteria : criterion.getCriterionList()) {
             AttributeCriterion attributeCriteria = (AttributeCriterion)criteria;
             List values = attributeCriteria.getValues();
             String qualifiedName = attributeCriteria.getAttribute().getName();
             int indexOfDot = qualifiedName.lastIndexOf(".");
             String name = indexOfDot < 0
                ? qualifiedName
                : qualifiedName.substring(indexOfDot + 1);
             ConjunctionCriterion partsCriterion =
                partsQuery.getValue().getConjunctionCriterion();
             for (Criterion partsCriteria : partsCriterion.getCriterionList()) {
                AttributeCriterion partsAttributeCriteria =
                   (AttributeCriterion) partsCriteria;
                String partsQualifiedName =
                   partsAttributeCriteria.getAttribute().getName();
                if (partsQualifiedName.endsWith(name)) {
                   partsAttributeCriteria.setOperator(attributeCriteria.getOperator());
                   List partsValues = partsAttributeCriteria.getValues();
                   partsValues.clear();
                   for (int i = 0, count = values.size(); i < count; i++) {
                      partsValues.set(i, values.get(i));
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ELContext elContext = facesContext.getELContext();
          ExpressionFactory expressionFactory =
             facesContext.getApplication().getExpressionFactory();
          MethodExpression methodExpression =
             expressionFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
          methodExpression.invoke(elContext, new Object[] { queryEvent });
    Then when the advanced/basic button is pressed for the visible query panel, I programmatically set the same mode for the hidden query panel:
       public void handleQueryModeChange(QueryOperationEvent queryOperationEvent) {
          if(queryOperationEvent.getOperation() == QueryOperationEvent.Operation.MODE_CHANGE) {
             QueryMode queryMode = (QueryMode) irQuery.getValue().getUIHints().get(QueryDescriptor.UIHINT_MODE);
             QueryDescriptor queryDescriptor = partsQuery.getValue();
             queryDescriptor.changeMode(queryMode);
             AdfFacesContext.getCurrentInstance().addPartialTarget(partsQuery);

  • Query based on a view

    Hello,
    Software: forms 10g
    problem: I have one block in my form based on a view. It works fine for my English language selection. However, when I switch to French I encounter an error.
    Example:
    Block name: REQUESTS_VIEW
    View_name: REQUESTS_VIEW
    Table: Requests
    Item_name: Office_id
    Column_name: Office_id
    Updatable/Queryable
    Item_name: Office_Name
    Column_name: Off_Eng_name
    Query only option selected
    LOV_OFFICE attached to item
    Office table contains the following columns:
    Office_id, Off_eng_name, Off_fre_name
    In my view I use a decode function for each variable that needs to be translated so that I select the correct column from my table. I did the same for the LOV attached to the office_name item.
    Problem: I cannot set the item_property column name to point to Off_fre_name when user selects French as a language, therefore, I get an error when I query. Oracle does not allow me to do that.
    Possible solution: To redesign each table and add a language column as follows:
    Office table
    Office_id, Office_name, language
    1, Head Office, 1
    1, Bureau Chef, 0
    language table
    language_id, language_name
    0, Français
    1, English
    However, this requires a redesign of my schema. Is there another way I can do this without changing the design structure?
    Thank you very much!
    Claudia

    As of 'I cannot set the item_property column name to point to Off_fre_name when user selects French as a language, therefore, I get an error when I query', I feel that you need to have two items-one for Off_Eng_name and another one for Off_fre_name on your form regardless of the language choice, but you need per language choice to hide the other language item. This way you don't have the above headache.

  • Query Based on two Characteristics

    Hi,
    I want to build a query on a multiprovider that has two characteristics :
    ZCYFLAG (posted values 'Y' or 'N')
    ZPYFLAG (posted values 'Y' or 'N')
    The query must must be restricted for ZCYFLAG = 'Y'  or ZPYFLAG = 'Y'.
    (If I drag drop these characteristics in global restricstons and specify ZCYFLAG = 'Y'  , ZPYFLAG = 'Y'  , the query takes only AND values ).
    Is there a possible work around?
    Pointers will be of immense help.
    Thanks & Regards,
    Rahul R Nair

    Hi,
    If you put in Global it applicable to entire Query.
    So You have to create 4 Selections with the restriction of the following condition in each selection.
    1. ZCYFLAG Restrict with 'Y' ZPYFLAG restrict with 'Y'.
    2. ZCYFLAG Restrict with 'Y' ZPYFLAG restrict with 'N'.
    3. ZCYFLAG Restrict with 'N' ZPYFLAG restrict with 'Y'.
    4. ZCYFLAG Restrict with 'N' ZPYFLAG restrict with 'N'.
    After this create one formula for these restrictions and use condition OR in between these Restriction variables at any time only one restriction condition will be satisyfyed.
    Regards,
    Shiva.
    Edited by: Shivu  Kumar on Sep 15, 2009 3:38 PM

  • Using geocode in a map based on a view where two datasets are joined

    Hi,
    I'd like to create a map based on a view in which two datasets are joined, where one of the datasets has a geocode column.
    Unfortunately this is not working... It seems that a custom view where two datasets are joined together where one of them has a geocode column makes the geocode column invisible for the map component.
    The following cases do work but we like to combine them so that we can combine different datasets in Studio without using the Integrator:
    - I can create a custom view in which we join two datasets > the view can be used as a source for different component but not the map component (it seems that the geocode column is not found)
    - I can create a custom view with a geocode column in it and that one can be used as a source for a map
    What I'd like to show is that it is possbile to have one datasets coming from a source system and that it is easy to combine an additional excel sheet with geo-information and maybe another excel sheet with different measures. This should be possible since you can join different datasets together in a custom view.
    Thanks in advance,
    Richard

    Oh sorry, we have two base views and one custom view:
    base view TRIS_Omzet which gets it data from an OBI server and has data like revenue, customer, time, etc.
    base view Endeca_Klanten which gets it data from an excel sheet, this view contains the name of the customer and the geocode of the customer's location
    We created one custom view (Omzet_Geo) where the two base queries are joined together using the following query:
    DEFINE V1 AS SELECT
    "Endeca_Klanten.Klanten" AS Klant,
    "Endeca_Klanten.Coordinaten" AS Coordinaten
    from Endeca_Klanten;
    DEFINE V2 AS SELECT
    "TRIS_Omzet.Naam_Consultant" AS Naam_consultant,
    "TRIS_Omzet.Jaar" AS Jaar,
    "TRIS_Omzet.Jaar_week" AS Jaar_week,
    "TRIS_Omzet.Actual" AS Actual,
    "TRIS_Omzet.Omzet" AS Omzet,
    "TRIS_Omzet.Partij" AS Partij,
    "TRIS_Omzet.Uren" AS Uren
    FROM TRIS_Omzet
    DEFINE Omzet_Geo AS SELECT
    V1.Klant AS Klant,
    V1.Coordinaten AS Coordinaten,
    V2.Naam_consultant AS Naam_consultant,
    V2.Jaar AS Jaar,
    V2.Jaar_week AS Jaar_week,
    sum(V2.Actual) AS Actual,
    sum(V2.Omzet) AS Omzet,
    V2.Partij AS Partij,
    sum(V2.Uren) AS Uren
    from V1
    right join V2
    on (V1.Klant=V2.Partij)
    group by Klant, Coordinaten, Naam_consultant,Jaar,Jaar_week,Partij
    Our view definition in the GUI looks like the following, as shown in the screenshots the datatype of the coordinated column is a Geo column both in the base view and the custom view. However the view still can't be selected to be used as a source for the map component.
    The two base views:
    The custom view:
    regards,
    Richard

  • Question - View with a join based on two unequal strings.

    Hello -
    First my apologies for the likely novice question.
    I'm creating a view based on two tables as such:
    SELECT *
    FROM table1 LEFT OUTER JOIN table2 ON table1.string = table2.string AND table1.number = table2.number
    Problem: table1.string looks like "A00A01%%%" and table2.string looks like "A1" (which would correspond to "A00A01%%%".
    Question: Can I create the join based on the 4th and 6th character of the string = the other string, or should I create a view with a formula creating a new field and then create a second view? (Note: creating or changing the field in the original table is not an option).
    Thank you.

    Hi,
    Yes, you can do that. Join conditions don't have to be as simple as "ON a.col1 = b.col2"; they can involve functions, like CONCAT and SUBSTR.
    For example:
    FROM            table1
    LEFT OUTER JOIN table2
    ON              SUBSTR (table1.string, 4, 1)
                    ||
                    SUBSTR (table1.string, 6, 1) = table2.string
    ...The query might be faster if you create a function-based index on the join condition from table1. This does not require changing table1 itself. (For a LEFT OUTER JOIN, like this, it probably won't matter.)

  • Implementing History types on query based view object attributes

    Hi All,
    I have to implement the history types
    created on,
    created by,
    modified on,
    modified by
    in my application, but I have all the Query based view objects in my work space, but according to my research History types can only be implemented on the Entity Objects attributes. So how can I do this for my application ? Any Solution ? Any alternative  please ?
    (NOTE: I have all the entity objects available in my common Model work space ).

    @TimoHahn, I have the following master view object query, which i can not generate by using the Entity objects, Basically I am transforming an oracle form base ERP into Oracle ADF application, so I have available all the quries , Please let me know if i can have any alternative solution ?
    SELECT  NVL(A.STYP,0) STYP,A.DAT,C.BATNO,C.ITST, B.DEMNO,B.ITEM,LTRIM(RTRIM(D.ITEMNAME))ITEM_NAME,0 TRINQ,D.UOM ABRV,P.DAT DDAT,
        A.CSNO,PARTY,NVL(CSRAT,0)+(NVL(CSRAT,0)*NVL(B.GST,0))/100 GSTCSRAT,CSRAT,
        A.PDAYS DAYS, DECODE(C.CSTERM,1,'CASH',2,'CREDIT',3,'DD',4,'PAY ORDER',5,'ADVANCE%',6,'CHEQUE') ,B.GST,E.MASTDS PNAME,NVL(SUM(B.RQTY),0)DRQTY,DEPT.SEC_NAME DEPTDS,SUM(STOK.QTY) BAL,P.TRNO,C.EBY, C.SYSIP, C.TDAT
                  FROM ACCSTORE.STAC_CSM A, ACCSTORE.STAC_CSD B,ACCSTORE.ST_STAC_DEM_APRVD C,ACCSTORE.VITEMS D, ACC_MAST E,ACCSTORE.PRE_DEMANDM P,ACCSTORE.VSECTIONS DEPT,
                  (SELECT STYP,ITEMID,SUM(BALANCE) QTY FROM ACCSTORE.VITEMSTOCK GROUP BY STYP,ITEMID) STOK
                  WHERE A.CSNO=B.CSNO AND B.CSNO=C.CSNO AND B.DEMNO=C.DEMNO AND B.ITEM=C.ITEM AND B.STYP=C.STYP  AND C.PDEMNO=P.TRNO(+) AND P.DEPT=DIVNO AND P.SEC_NO=DEPT.SECNO(+)
                              AND C.STYP=STOK.STYP AND C.ITEM=STOK.ITEMID
                    AND C.STYP=D.STYP AND C.ITEM=D.ITEMID AND C.PARTY=E.MASTCD  AND B.APP=1 AND NVL(C.PONO,0)=0 
                    AND C.ITST=DECODE(C.STYP,0,11,14)
                    GROUP BY NVL(A.STYP,0),A.DAT,C.BATNO,C.ITST,B.DEMNO,B.ITEM,D.ITEMNAME,A.CSNO,PARTY,P.DAT,DEPT.SEC_NAME,P.TRNO,C.EBY, C.SYSIP, C.TDAT,
                    CSRAT,A.PDAYS,C.CSTERM,B.GST,E.MASTDS,D.UOM ORDER BY A.CSNO,D.ITEMNAME
    ORDER BY "DAT" DESC
    which i can not generate by using the Entity objects, Basically I am transforming an oracle form base ERP into Oracle ADF application, so I have available all the quries , Please let me know if i can have any alternative solution ?

  • Report based on two (or more) views

    Hi,
    Situation is this - I have two views, which have same type and number of rows. My goal is to create a report which has one bind variable (let's say ':query_nr') so, that when :query_nr=1 then report shows data only from the first view, and when :query_nr=2 then only from the second view. I know that the operator UNION ALL
    would do the job:
    select * from view_1 where :query_nr = 1
    UNION ALL
    select * from view_2 where :query_nr = 2
    but since the amount of data is large, then the execution time is unacceptable.
    Is there any other way to approach?
    Thanks in advance,
    Madis

    How does the query perfom from sqlplus. There is no way we can make a query execute faster from a portal report than it does from sqlplus.
    There are a few things you can try out like
    1. having not too many rows per page
    2. using a text format
    3. not using condtional formatting

  • Applying different view criterias to af:query based different situations

    Hi all;
    Lets say i have 3 different view criterias ....and i want to apply only one of them to af:query based user's role....
    I dont have an idea how to do that...My only clue is my supervisor mentioned to me i can use page definition to do that;
    <searchRegion Criteria="DepartmentViewCriteria" Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="DepartmentView1Iterator" id="DepartmentViewCriteriaQuery"/>Can u help me on this matter please!
    If post is too shallow to understand i can elaborate more...
    jDeveloper 11.1.2.1.0
    Oracle DB 11g

    Create a custom public method in yr applicationmoduleImpl class. Get the viewcriteria of target vo or programmatically create yr viewcriteria.
    Based on current loggedInUser role which can be access by ADFContext.getCurrent().getSecurityContext().getUserRoles(), u can apply specific viewcriteria on VO.
    After that u can follow this link - http://dstas.blogspot.com/2010/09/adf-11g-methodaction-and-invokeaction.html, from +"We will now expose the method in the client interface of the AM"+ teopic.
    At the end u will be able to execute this method from pagedef file, whenever u enter to this page.
    Hope this helps.

  • How to access query based view object in backing bean

    Hi
    I am using JDev11.1.2.1.0
    I want to use the query result of query based view object in backing bean.
    How can i do the same
    Please Solve this
    Thanks

    Hi,
    Assuming ADF is in the picture
    1. Create a PageDef file for the page (right mouse click "Go to Page Definition")
    2. In the Executable section, create an iterator for the View Object
    3. In the managed bean:
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    DCIteratorBinding iter = (DCIteratorBinding ) bindings.get("name of Iterator");
    iter.execute();
    // ... navigate the iterator rows ...//
    Frank

  • Select One Choice attribute' LoV based on two bind variables, best practice

    Hello there,
    I am in the process of learning the ADF 11g, I have following requirement,
    A page must contain a list of school names which is needed to be fetched based on two parameters, the parameters are student information been inserted in the previous page.
    I have defined a read only view "SchoolNamesViewRO", it's query depends on two bind variables :stdDegree and stdCateg.
    added that RO View as a view accessor to the entity to which the name attribute belongs, and then add LoV for the name attribute using the ReadOnly view,
    added the name attribute as Select One Choice to page2,
    and now I need to pass the values of the bind variables of the ReadOnly view,
    the information needed to be passed as the bind variables is inserted in the previous page, I could have the data as bindings attribute values in the page2 definition
    I have implemented the next two appraoches but both resulted in an empty list :
    * added ExecuteWithParams Action to the bindings of the page and then defined an Invoke Action (set refresh condition) in the executable s, set the default values of the parameters to be the attributes values' input value,
    in the trace I code see that the binding fetches correct values as supposed , but the select list appears empty, does the this execution for the query considered to be connected to the list ?
    * added a method to the ReadOnly view Imp java class to set the bind variables, then I define it as a MethodAction in the bindings , and then create an Invoke action for it , also the select is empty,
    if the query been executed with the passed variables, then why the list is empty? is it reading data from another place than the page!
    and what is the best practice to implement that requirement?
    would the solution be : by setting the default value of the bind variables to be some kind of Expression!
    please notice that query execution had the bound variables ( I see in the trace) are set to the correct values.
    would you give some hints or redirect me to a useful link,
    Thanks in advance
    Regards,

    please give me any example using backing bean .for example
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:selectOneChoice label="Label 1" id="soc1" binding="#{Af.l1}"
    autoSubmit="true">
    <af:selectItem label="A" value="1" id="si1"/>
    <af:selectItem label="B" value="2" id="si2"/>
    </af:selectOneChoice>
    <af:selectOneChoice label="Label 2" id="soc2" disabled="#{Af.l1=='2'}"
    partialTriggers="soc1">
    <af:selectItem label="C" value="3" id="si3"/>
    <af:selectItem label="D" value="4" id="si4"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    package a;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    public class A {
    private RichSelectOneChoice l1;
    public A() {
    public void setL1(RichSelectOneChoice l1) {
    this.l1 = l1;
    public RichSelectOneChoice getL1() {
    return l1;
    is there any mistake

  • Dynamically subsetting a LOV based on a View Object

    Hi,
    Hoping you guys can help out. I am having issues with Partial Page Refresh and Dynamically
    STATUS table ( STATUS_ID NUMBER, STATUS_NAME VARCHAR2(10)) with values 1 = Open, 2 = Won, 3 = Lost
    ACTIVITIES ( ACTIVITY_ID NUMBER, ACTIVITY_NAME VARCHAR2(20), STATUS_ID NUMBER)
    The list of permissible activities is dependent on the value of the Status Id and both are shown as LOV's in the same popup/dialog.
    I've created EO's and VO's for both tables. I've created a query based view object called voPermissableActivities with sql "select * from activities act where act.status_id = :pStatusId " and have set up the bind variables, etc.
    Against the Activities VO I created a LOV for the ActivityId using the voPermissableActivities.
    I've set the autosubmit property of the Status Id LOV to true and created a ValueChangeListener for the Status LOV in the backing bean. I've also set the partialRefresh property of the Opportunity LOV to point to the Status LOV
    In the StatusChange listener I
    1. get the a DCIteratorBinding which points to the view iterator underpinning the two LOV's
    2. using the iterator I get the value of the Status LOV
    3. I then grab a reference to the ViewObject for voPermissableActivities and set the bind variable pStatusId to reflect the value of the Status LOV using the following code snippet
    ViewRowSetImpl vOppRSI = (ViewRowSetImpl) currentRow.getAttribute ( "voAccountOpportunity1");
    ViewObject voOpportunities = vOppRSI.getViewObject();
    voOpportunities.setNamedWhereClauseParam("StatusId", currentRow.getAttribute("StatusId"));
    System.out.println ( "Est. Row Count : "+voOpportunities.getEstimatedRowCount());
    voOpportunities.executeQuery();
    System.out.println ( "VO Query: "+voOpportunities.getQuery());
    I've got a tonne of debugging code in the method and can see the server log accurately reflecting changes at the UI layer - so I know it's working properly - also the estimatedRowCount returns values I would expect to see. However, the values in the LOV based on the voPermissableActivities view are not changing. So, I'm guessing that the LOV does not properly get refreshed !? or at least, the ADF framework does not automatically refresh it. So, I then found the following snippet to pogrammetically refresh the LOV -
    System.out.println ( "Getting ADF Context");
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    System.out.println ( "Calling PPR") ;
    adfFacesContext.addPartialTarget(getLovOpportunityId());
    System.out.println ( "after calling ppr");
    Any ideas? This is driving me crazy !!!

    Cheers Frank,
    That works fine where I have a discrete and manageably small set of potential values - in the snippet I included there were 3 potential values - and it is feasible to prepare three VO's to drive the LOV. However, in the PRODUCTION version of what I'm trying to do I may have many more.
    Any other thoughts?
    One approach I wanted to explore was dynamically creating the VO at run time. Would that work?

  • Detail tabular form based on two tables

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i have a master detail form based on two tables , the detail form ofcourse based on one table , the problem is i want to include a column of another
    table into the tabular form , so i have changed the query of the tabular form and included the column in it correctly ,
    but the problem is about saving data , i can not save the data , i think
    because the "mru" process is based on one table , that is because i face an error talking about "mru" process when i try to save the data ,
    Error in mru internal routine: ORA-20001: no data found in tabular form Unable to process update.
    so
    what should i do to save the data ? should i create another "mru" process based on the other table or what ?
    thanks

    Anything beyond "simple" requires that you do it yourself.  I believe that what you want is "beyond simple"
    As far as I know, you can only use the 'mru' on one table.
    (I could be wrong)
    If the conditions are right, you might be able to simplify things such that you can use the 'mru'.
    ie CREATE VIEW on the two tables.
    However, you need to understand how Oracle treats DML operations on views, what type of views can be updated, etc., etc.
    If just creating the view doesn't work, creating an INSTEAD OF trigger on the view come to mind...
    (lol) - at that point, you have already started down the 'dark path' of creating your own 'MRU'
    personal note:  triggers have a really baaaddd habit of hiding code from other developers.  you are better off, in the long run, creating your own 'mru'..
    ie a package with procedures to handle INSERT, UPDATE, and DELETES
    MK

  • How to create spatial query (sdo_relate) on 2 views

    Hi, I want to create a spatial query in the form of:
    select /*+ORDERED*/ column1,column2
    from view1,view2
    where sdo_relate(view2.geometry,view1.geometry,'mask= ... ')Both views are very fast and return a smal number of rows out of a large dataset. I would expect that running the spatial query on this selection should be fast but when performing the above query it takes quite some time.
    It seems that the spatial query is performed on the underlying tables before the views make their selection.
    What is a good way to handle this kind of problem? How to make the spatial query to be executed on the resultset of the views?
    thanks Rene

    Hi Udo,
    Let me tell you a bit more about the requirements of the application.
    We have a table with geometries. Some geometries are buildings, others are roads, trees, parking areas, etc.
    We let users specify what geometries they are interested in. This can be the type (tree, building) or a list of types, plus some other selection such as type of tree, name of road etc. Based on the specifications the application creates a view that returns exactly the geometries the user is interested in.
    Users may not only be interested in just a tree but may be looking for a tree located inside a building, or a building within a certain distance from a road. This then would be the query I am talking about in this post. Two views and a spatial relationship between them.
    Depending on the definition of the views and the data currently loaded the number of rows returned by the views will vary. I can't be there all the time making sure that the correct table is queried first and the correct hints are given. This is why we have the CBO. But it seems to do a poor job when it comes to spatial queries.
    Rene

  • One block based on two table when update/insert result in FRM-40654

    Hi,
    I ahve a multi line block based on two tables.
    Customers - AFCUSTOMER
    Maintenance - AFMAINT
    Some customers exist when maintenance doesnt so in my where clause i have
    AFCUSTOMER.CUSTID=AFMAINT.MAINT_CUSTID(+) AND AFCUSTOMER.CUSTBRANCHID=1 AND AFCUSTOMER.CUSTSTATUSID=2
    I have primary key set as the AFMAINT table primary key and have set DML data targetr name as AFMAINT.
    I am displaying customer name (from AFCUSTOMER) and type of payment (from AFMAINT) on screen and i want to change the type of payment which then uses pre update trigger to fil in the primary key of AFMAINT.
    Querying works fine and displays all records. But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another user. I have checked and block status is QUERY right before the list item is changed.
    Any ideas on where i am going wrong.

    But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another userWhen you start editing a record which is already stores in the database forms "rereads" the record from the database and check id all values in the database are the same as in the form. If there is some difference, forms assumes that someone else changed the record after you did the query.
    The main causes for that are:
    -Some database-trigger which changes the value of a column which is included in the form
    -numeric column with a higher precision in forms, than in the database
    -a block based on a view or "select from clause" which does not return the same values as inserted/updated through forms.
    I guess you run into the third issue. Check all the values in the forms-items after your dml and compare them to the values saved to the database, there will be some difference. If you find it, correct the error, if one, or re-read the data in the POST-UPDATE-trigger.

Maybe you are looking for