LOV based on multiple views

Is it possible to create a dynamic LOV that is based on multiple views? If so, how? Example code?

I got it to work, however the order is still lacking. I tried using "order by" but it only worked if there was only 1 view. Perhaps I am setting up the code incorrectly.... and I am a bit foggy on what you mean about the 3rd column. What is supposed to be in that third column that would make it order, and how do you stop it from being in your final results?
Thank you very much for your help!!

Similar Messages

  • Table based on multiple views

    Hello all,
    Is it possible to populate a table with data from multiple view objects that are linked with a view link?
    The reason i want to do this is because if you update the reference ID in the master the detail automatically follows.
    Now, I know i can create a view object and then include the detail info using expert mode, but this way the detail info doesn't change if i change the reference ID.
    To conclude, a brief explanation of what i'm trying to achieve.
    I have a table with adresses. Having a reference ID to the ZIP table.
    Because the user doesn't know all the ID's by heart i show the name of the city and the user can change them by clicking on a lov button. This all works fine, BUT, when the city is changed the old one stays visible for the user. Although committing, changes the city to the new one.
    Regard
    Johan

    Keeping in mind what Dave just said, you would be better off creating your GTT once. Then reusing it over and over again. Using GTTs is advantagous in that its contents are visible only at the session level, and depending on how the GTT was created it will either automatically truncate the table on commit (the default if not otherwise specfied) or truncate the table at the end of your session regardless of commits.

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

  • Adf table data based on web service -  LOV based on entity / View

    My tools version:
    Jdev: 11.1.2.3.0
    ADF essential 11.1.2.3
    My case:
    I have a data table based on webservice (client and proxy). In this table I have status ID field, I would like to show the status ID description, I have also a LOV View (based on entity).
    I try a lot things, but nothing work, could you please give an idea to show my status description in my data table for each line?
    Thanks a lot

    Frank,
    I would like to get the status description from the ADF BC LOV, because in my table (based on the webservice) I have only the ID status.
    It is possible?
    Regards
    KM

  • Form based on a VIEW

    hi I have a form based on multiple views
    when try to query the data in this form
    I get this error
    An unexpected error occurred: ORA-01445: cannot select ROWID from a join view without a key-preserved table (WWV-16016)
    An unexpected error occurred: ORA-01445: cannot select ROWID from a join view without a key-preserved table (WWV-16016)
    null

    Right now you will be able to base a portal form only on updatable views. Non updatable views are not supported.
    As a work around you can use QBE reports to query the data, without having the delete and update links.
    Regards,
    Sunil.
    null

  • Can LOV base on a view?

    Hi,
    My client created a LOV based on a view. She attached the LOV to a form. When she runs the form, she chooses from the LOV, and insert a record. She tries to query what she just inserted, nothing shows up. She is using version 3.06 on HP unix.
    I did the same thing as she did, but I have version 3.07 NT on my laptop. I have no problem insert and query the record using a LOV based on a view. Is it a bug for 3.0.6?
    Thanks;
    Kelly.

    Kelly,
    This could be a bug in 3.0.6, but I'm pretty sure this is related to LOV style (popup lov most likely) rather than fact that it is based on a view. There was a number of bugs fixed in 3.0.6 - 3.0.8 timeframe, you may check the bug database for that.
    Thanks,
    Dmitry

  • Want to update data in a view based on multiple tables

    Hi
    I am facing a problem i want to update data in tables using a view. As that view is based on multiple tables so i am unable to update data. i came to know we can update table from view only if view is based on single table. so if anyone knows any alternative please let me know.
    Thanx
    Devinder

    Devinder,
    The table can be updated through a view based on multiple tables, if and only if the table is a "key preserved" table. Rather than explaining myself, i avoided the burden of typing by finding the material in Oracle Docs and pasting it for you :-)
    If you want a join view to be updatable, all of the following conditions must be
    true:
    1. The DML statement must affect only one table underlying the join.
    2. For an INSERT statement, the view must not be created WITH CHECK
    OPTION, and all columns into which values are inserted must come from a
    key-preserved table. A key-preserved table in one for which every primary
    key or unique key value in the base table is also unique in the join view.
    3. For an UPDATE statement, all columns updated must be extracted from a
    key-preserved table. If the view was created WITH CHECK OPTION, join
    columns and columns taken from tables that are referenced more than once
    in the view must be shielded from UPDATE.
    4. For a DELETE statement, the join can have one and only one key-preserved
    table. That table can appear more than once in the join, unless the view was
    created WITH CHECK OPTION.
    HTH
    Naveen

  • Lov based on a dynamic view object

    Build JDEVADF_11.1.2.0.0_GENERIC_110531.1615.6017
    Hi,
    I have a database table containing a column with the Name of a Table as content.
    I created a dynamic view and overwrite this with a method in Appmodule.
    Then I add to the element in the main view the Lov. I execute the method in JSP page.
    But the SelectOnechoice list is empty!
    Where is the problem? How can I create a Lov based on a dynamic view object?
    Thanks in advance and best regards
    Edited by: NewBB on 12.08.2011 00:53

    Hi Neliel,
    thank you for your reply.
    My problem is not the same. I can also see my dynamic view objects as selectonechoice. I have a table T1 has a column t1c1 (Number),
    another table T2 (dynamic view object) with two columns t2c1 (Number) and t2c2 (varchar2).
    In my application I want to represent the values of t1c1 as selectonechoice with the values of t2c2.
    and that does not work. My list is empty. Any idea???

  • How to create LOV not based on a View Object attribute?

    Hi,
    I am creating a handed-made search form and I want to create an af:inputListOfValues.
    I have :
    - a read-only-view-object to get the LOV values from BD.
    - af:inputListOfValues tag (droped from Component Palette).
    How can I create the listOfValuesModel in Bindings layer? (the inputListOfValues is not based on a View Object attribute).

    Sorry, I think I am not very clear in my posts.
    My requirement is to create a LOV but I have no ViewObject. I just want an input (not based on a view object attribute), alone, but with a LOV (where lov's datas are get from a view object).
    In a "normal" LOV I would have something like this :
    in jsff :
    <af:inputListOfValues id="departmentIdId"
                                popupTitle="Search and Select: #{bindings.DepartmentId.hints.label}"
                                value="#{bindings.DepartmentId.inputValue}"
                                label="#{bindings.DepartmentId.hints.label}"
                                model="#{bindings.DepartmentId.listOfValuesModel}"
                                required="#{bindings.DepartmentId.hints.mandatory}"
                                columns="#{bindings.DepartmentId.hints.displayWidth}"
                                shortDesc="#{bindings.DepartmentId.hints.tooltip}">
            <f:validator binding="#{bindings.DepartmentId.validator}"/>
            <af:convertNumber groupingUsed="false"
                              pattern="#{bindings.DepartmentId.format}"/>
          </af:inputListOfValues>in pageDef :
    <listOfValues StaticList="false" IterBinding="EmployeesView1Iterator"
                      Uses="LOV_DepartmentId" id="DepartmentId"/>in model layer : a view object (EmployeeView) with view accessor and LOV based attribute, and a read only view object (DepartmentRVO) to get datas for the LOV.
    But in my case I have no ViewObject, so I don't know how to create the listOfValuesModel in fragment pageDef.
    I have :
    <af:inputListOfValues label="Label 1"
                                    popupTitle="Search and Result Dialog"
                                    id="ilov1" model="here I want to point to a listOfValuesModel but I don't know how to create it"/>in pageDef : the listOfValuesModel but I don't know how to create it.
    in model layer : just a read only view object (like DepartmentRVO), to get the datas for the LOV.
    Edited by: h0s on 29 févr. 2012 00:31

  • Create LOV based on view with problem - repost

    Hi,
    I have the following scenario:
    1. Create a view based on several tables from a remote database using db link.
    2. Create a LOV based on the created view. In the LOV, I have the where clause
    " where user_name = portal30.wwctx_api.get_user" because I only want individual
    portal user to see his/her own choices.
    However, when I try to test the LOV, it just hangs.
    3. If I create a table based on the created view, and create a LOV based on the newly
    created table, also use the same where clause -
    "where user_name = portal30.wwctx_api.get_user". The LOV returns correctly.
    Why is this happens? And what can I do to make the Lov works from a view instead of table?
    Thanks;
    Kelly.

    Hi Erwin,
    I have a similar situation.
    Tabular form based on a view. The view contains a table in a another instance via dblink and everything works fine.
    The only one difference between my and your view is that my "instead of" view is only for UPDATE. You must to have "intead of" trigger only for UPDATE. Insert and delete works fine withoust "instead of" trigger.
    So, try to delete INSERT and DELETE words from your "INSTEADOFBUBA" trigger.
    hope it helps,
    Mzz

  • One select list with multiple LOV's (LOV based on how page was called)

    APEX 4.0.2
    I've a DML form page from a report on which I need a single select list item to have a differing LOV based on how the form page was called.
    The calling page (report), contains an edit link column and a create button. Depending on which is selected, I wish the LOV for my select list item to change. The idea behind this is that if someone creates a new entry, I want to constrain the select list to a subset of rows of a table query populating the LOV. On the other hand, if an existing item is edited, I want the select list LOV containing all rows of a table query populating the LOV.
    What I've tried...
    - Duplicates of select list item each triggered to render based on an arbitrary value set when either "create" or "edit" are selected. This did not work because the item was part of DML and would not allow replication on the same page.
    - Logic in the LOV sql statement controlling which sql was to be run based on an arbitrary value set when either "create" or "edit" are selected. This did not work as logic is not allowed in LOV sql statements.
    Any thoughts? Many Thanks!
    Paul

    Hello Patrick!
    Thanks for responding - Love your captcha plugin!
    Anyway, these are the two dynamic LOV's. The first I have in play right now (when creating new records). I need to have the other for existing record modifications.
    LOV #1
    select stock_no d, stock_no r
    from   [email protected]
    where  status like '%Awaiting Transfer%'
    or     status like '%On Hold%'
    order by 1LOV #2
    select stock_no d, stock_no r
    from   [email protected]
    order by 1As I mentioned, I attempted to use plsql logic in the query to trigger one or the other based on a value set when the user either clicked an edit link or a create button but couldn't get the dynamic LOV to commit with that extra code in it.
    Thanks!
    Paul

  • Can Numbers Display Multiple Views of the Same Table

    Hi,
    Excel and Appleworks both have a pull down tab on the vertical bar allowing multiple views into the same spreadsheet (table). Can Numbers do this?
    I have a set of calculations at the top of a spreadsheet that are based on years and years worth of data under the calculations (same column). I add data for each new event (the rows) and watch the calculations at the top of the data. Easy to do in Excel or Appleworks, but, I can't figure out how to do this in Numbers.
    Example:
    Spot1 Spot2
    Total 15 36
    Avg 5 12
    Jan 09 5 10
    Feb 09 6 20
    Mar 09 4 6
    Apr 09
    So... does Numbers allow the view "split" or multiple views that Excel and Appleworks allow?
    Thanks!
    Tom

    Question asked and responded several times:
    feature unavailable.
    For multiple views of a table there is an easy workaround as we may build a table whose every cells grab their contents from the 'master' one.
    _Go to "Provide Numbers Feedback" in the "Numbers" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'10
    Yvan KOENIG (VALLAURIS, France) mardi 1 septembre 2009 21:56:42

  • Creating a LOV based in a Web Service

    Hey guys...
    I need to create a Lov based in a Web Service Result, but in always getting the same error:
    LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Queries that I'm trying:
    Original Query:
    select extractValue(value(t),'/*/imgLocation','xmlns="http://oracle.ovs.api/types/"') "imgLocation"
    , extractValue(value(t),'/*/imgName','xmlns="http://oracle.ovs.api/types/"') "imgName"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//getAllTemplateResourcesResponseElement/result','xmlns="http://oracle.ovs.api/types/"'))) t
    where c.collection_name = 'P1_GETALLTEMPLATERESOURCES2_RESULTS'
    Other Query that I tried:
    select imgLocation, imgName from (
    select extractValue(value(t),'/*/imgLocation','xmlns="http://oracle.ovs.api/types/"') "imgLocation"
    , extractValue(value(t),'/*/imgName','xmlns="http://oracle.ovs.api/types/"') "imgName"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//getAllTemplateResourcesResponseElement/result','xmlns="http://oracle.ovs.api/types/"'))) t
    where c.collection_name = 'P1_GETALLTEMPLATERESOURCES2_RESULTS')
    And I tried creating a view, but I dont know where I have to put this.. Maybe in another process?
    create view as
    select imgLocation, imgName from (
    select extractValue(value(t),'/*/imgLocation','xmlns="http://oracle.ovs.api/types/"') "imgLocation"
    , extractValue(value(t),'/*/imgName','xmlns="http://oracle.ovs.api/types/"') "imgName"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//getAllTemplateResourcesResponseElement/result','xmlns="http://oracle.ovs.api/types/"'))) t
    where c.collection_name = 'P1_GETALLTEMPLATERESOURCES2_RESULTS')
    Thanks

    Fox,
    I'd start by adding column aliases D and R to the query and see if that helps.
    Greg

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

  • How to change the values in an LOV based on values selected in another LOV

    Hi,
    I have a requirement in ADF where there are two LOVs. Based on the values that I select in the 1st LOV, the values in the second LOV should change dynamically.
    Also, the 1st LOV accepts 3 values, for every value I select, a different query is executed to populate the 2nd LOV.
    I have a rough thought that I can use 3 different read only view objects containing these 3 queries. And based on the value I select in the 1st LOV I can execute the corresponding View object from the backing bean. But my doubt is how to link the results of that query that is executed to populate the 2nd LOV.
    Thanks in advance.
    Edited by: 886591 on Sep 21, 2011 4:48 AM

    Hi Brisk,
    Thanks for your reply.
    The link that you have provided explains how to disable and enable the other LOVs based on a parent LOV. But in my case there are two Select One Choice fields i.e. the dropdowns (sorry that I addressed it as LOV in my previous post which might be confusing). There are 3 static values in the parent dropdown where each of them are associated with a different query. for e.g if the three values in the drop down are A, B and C; if i select A, then query associated to A should be executed ; if i select B, then query associated to B should be executed and if I select C, query associated to C should be executed. Then the output attribute of that query should be populated in the child dropdown.
    Please let me know about the solutions to this.
    Thanks,
    Kavitha

Maybe you are looking for