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.

Similar Messages

  • 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

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

  • 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

  • How to create materialized view based on a view?

    Hi,
    I hope this is not very far fetched idea.
    I have a very complex view and I would like to replicate it 'in place' that is I would like to make a materialized view that is based on this view complex view. I would like to use this materialized view (i.e table) to query data instead of using the original view, since it takes Oracle some 10-15 seconds to execute my query on the original view and I am not allowed to create indexes on most of the tables that are included in the original view.
    Can this be done?
    Best regards,
    Tamas Szecsy

    The best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
    select text
    from user_views
    where view_name = 'NAME_OF_VIEW'
    You can then cut and paste the sql statement into your create materialized view statement.
    Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
    SQL> set long 2048

  • 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

  • Creating Infoset query based on ABAP program

    Hello
    I have 3 tables FEBEP, BKPF and BSEG and I need to join the 3 tables based on:
    FEBEP-MANDT = BKPF-MANDT = BSEG-MANDT
    FEBEP-NBBLN = BKPF-BELNR = BSEG-AUGBL
    FEBEP-GJAHR = BKPF-GJAHR = BSEG-GJAHR
    Then I have a few view fields from all the 3 tables. After this I can build an infoset query based on structure + ABAP program, and a generic datasource on top of it.
    Can someone give me the ABAP code to be written SE38? Also should I select integrated program/external program in the infoset query?
    Thanks,
    Srini.

    Hi,
    Even if you create an ABAP program for infoset, you will writing a SELECT statement from BSEG table which is quite huge.
    And you will putting JOIN with other tables.
    Performance wise this is not advisble.
    Why do not try the following other tables and check if the fields you need are available?
    You can't join BSEG as it is a Cluster Table.In the place of BSEG you can use:
    Account Recivables data use BSID and BSAD tables
    GL Account Related data use BSIS and BSAS tables
    Account payables data use BSIK and BSAK tables
    Thanks.

  • Query based collections SCCM 2012 R2

    Hi to everyone. Is there any book or other material needed to master process of creating query-based collections? It is done using WQL not T-SQL so it is a little bit tricky, not only syntax itself but also classes where particular information useful to
    create custom query-based collection can be found. I used WQL before only to create WMI filters for some GPOs in order to narrow their scope e.g. only to Windows 7 workstations in domain. These WMI filters were usually created
    with one short WQL line, it was very simple WQL query. Bare in mind all classes that exist in SCCM database googling can be useful to solve some problems but it would be better to have some book and to master creation of query-based
    collections.  

    Hi,
    You could review the file smsprov.log.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • Disc 4137 - query based on login?

    We have a sales table in Discoverer that we want to allow sales managers to access so they can define their own ad-hoc queries. However we only want them to be able to query based on sales attributed to them i.e. they can't query on other sales managers.
    I know I can build business areas for each sales manager and create a custom folder in each area with the sales manager pre-defined to limit queries but to simplify the maintenance I'd like to be able to limit the queries based on how the user logs into Discoverer. i.e. username 'ABC' logs in; view has logic to recognize 'ABC' as the username and automatically sets a condition to sales_manager='ABC'.
    Is something like this doable with Discoverer? I know we can get the username via forms but didn't know if Discoverer offered this functionality too.

    Actually, what's been said is correct for database EULs.
    However, for Apps-EULs, it is possible to determine the Oracle Apps user and/or the Oracle Apps responsibility that's presently logged in to Discoverer (requires an external routine to be registered but it's an Oracle one).
    Then, if an Apps-EUL, you can limit the folder in the EUL to that responsibility, etc. in the same fashion as stated for the DB-EUL.
    Note that some of the views in the database may indeed only show info for a particular apps user / responsibility, but these views are usually only the BIS views and if you look at the code to these views, it's obvious as one of the last lines will refer to a package such as: HR_Security_Pkg or GL_Security_Pkg.
    However, if you're going straight to an Oracle table and it's an Apps-EUL, then what I mentions works - done it many times now.

  • Report based on a view

    Hi,
    On my page I have a select list with submit (--> computes an application item AI_OEFID) and I have a "form with report" based on a view.
    In my Region Source I have added a where condition: where "EMPID" = :AI_OEFID.
    When I select an employee in the select list the report only shows data of the selected "EMPID", which is fine.
    The "null display value" of my LOV is "Choose employee..."
    When I select "Choose employee..." the report shows "no data", BUT at that moment I want all my employees shown in the report.
    So, I tried the following: I changed my where condition: where "EMPID" IN (:AI_OEFID) and I created another (conditional: when value of LOV = -1) Page Processing computation which computes my application item AI_OEFID with the result of a SQL query: select EMPID from <<VIEW>>.
    When I select "Choose employee..." the report shows only my first EMPID.
    How can I show all my employees in the report when I select the "null value" of my LOV ?
    Thanx,
    Frederik.

    Frederik,
    Have a look at this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:99
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

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

  • 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

  • Lookup table with a block based on a view

    Hi!
    My form contain one module component based on a view, one of the items of my block is a libelle that exist in one
    of the tables queried by the view.
    my question is :
    how can I have a LOV on this item in order that the user select a value for a query???
    or, can I make a lookup table with a view ????
    Thanks!

    You said you copied an existing item in the block, and then copied an existing item in the layout editor - is it possible you actually created 2 separate items? Remove the one in the layout editor, and set the canvas of the one in the block so it is displayed in the layout editor. That could be the problem.

Maybe you are looking for

  • Accouting FI document is not generating at sale billing (VF01)

    Hi gurus, I am able to generate sales billing at sd (VF01), but Accouting document is not getting generated. Can any one help to correct this issue. Regards, RAM

  • Reorganization of MsSql ?

    Using Mssql 2005 we see is available the "SQL Server Integration Services (SSIS)" tools from Microsoft. It allows actions like 'Reorganize DB and Indexes' and skrinkdatabase. We would like to know if these actions can be executed on a MsSql running a

  • Get user sessions in ABAP

    Hi, my problem is to get active sessions of a specific user (as I can see from SM04, selecting a row and clicking "Session") The program behind SM04 is RSM04000_ALV; the call 'ThUsrInfo' id 'OPCODE' field opcode_list id 'TABUSR' field usr_tabl-sys ge

  • Can't exit out of dialogue box in After Effects

    Hi, A couple of times now I have accidently reduced my cameras scale below 0% and have had this dialogue box appear. When I click 'OK' it just keeps popping up again. I have no way of exiting out of it and resuming my work. The last couple of times I

  • How to disable wireless for Version 4 G LTE Broadband Router with Voice?

    How can I disable wireless on the Version 4 G LTE Broadband Router with Voice?