Decode statement in Select line of a View Object Query

I attempted to create a view object in expert mode with a customized query.
The query had a decode statement in the select line of the query. The view
object compiled correctly but gave an error when run.
ex: select .... decode(CrpSchools.SCHOOLS_ID,null,CrpCustSchools.SCHOOL_NAME,CrpSchools.SCHOOL_NAME) SCHOOL_VALUE, ...
from ....
where ....
The error was that school_value does not exist in the statement. I got the error when
doing a vo.executeQuery().
When I removed the decode statement everything worked correctly. Does anyone know if
the decode statement cannont be used in the select line of a query in a view object?
Or maybe I was linking the query column (SCHOOLS_ID) up to the view attribute (SCHOOL_VALUE) incorrectly in the
Attribute Mappings tab of the VO wizard?

There should be no problem using a DECODE() statement, provided that you've aliases the column as you have done.
At design time, if you click on the (Test) button, does your query test ok?
Are you by chance applying a custom where clause at runtime?
If so, are you saying:
setWhereClause("yourtable.column_alias = ?";
or are you doing:
setWhereClause("column_alias = ?";
for an expert-mode query, you'll need to use the latter syntax.

Similar Messages

  • How To change the ADF View Object  query where-clause at RunTime?

    I am trying to create a simple display page which will display user data (username, assoc_dist_id, assoc_agent_id, status , etc). The User data is stored in a database table and i am using an ADF Read Only table based on the View Object to display the data on the JSF page.
    However, i want to display only the users that a particular person accessing the page has the AUTH LEVEL to see. e.g. If the person accessing the page is an 'ApplicationAdministrator' then the page should display all users in the table, If its a 'DistributorAdministrator' then the page should display only users associated with that Distributor (i.e. assoc_dist_id = :p_Dist_id ) and If its an 'AgentAdministrator' , then the page should display only users associated with that Agent ( i.e. assoc_agent_id = :p_Agent_id).
    Currently my af:table component displays all the users in the table because the query for the view object is (select * from users) . However, i want to use the same viewobject and just set the where-clause at runtime with the appropriate parameter to restrict the dataset returned.
    Do anyone knows how to accomplish this ?

    David,
    See the custom method initializeDynamicVariableDefaults() in the SRViewObjectImpl.java class in the FrameworkExtentions project in the SRDemoSampleADFBC sample application. You can find out how to install the demo if you haven't already from the ADF Learning Center at:
    http://www.oracle.com/technology/products/adf/learnadf.html
    This class is a framework extension class for view objects that adds a neat, generic feature to be able to dynamic default the value of named bind variables. You can read more about what framework extension classes are and how to use them in Chapter 25, "Advanced Business Components Techniques" of the ADF Developer's Guide for Forms/4GL Developers, also available at the learning center above.
    It is an example of generic framework functionality that "kicks in" based on the presence of custom metadata properties on a named bind variable. See section 25.3.3 "Implementing Generic Functionality Driven by Custom Properties" in the dev guide for more details. Using this sample code, if you add a bind variable to a view object, and define a custom metadata property named "DynamicDefaultValue" on that bind variable, and set this custom metadata property to the value "CurrentUser", then that bind variable will have its value dynamically defaulted to the name of the authenticated user logged in. If instead you set this custom property to the value "UserRole", then the bind variable will be set to the comma-separated string containing the list of roles that the authenticated user is part of.
    Once you've created a framework extension class for view objects like this, you can have the view objects you create inherit this generic functionality.See section 25.1.4 "How to Base an ADF Component on a Framework Extension Class" in the dev guide for more info on this.
    By adapting a technique like this (or some idea similar that better suits your needs) you can have your view object query contain bind variables whose values automatically take on the defaults based on something in the user-session environment.

  • View object query bind variable

    I have a bind variable in my view object query and "Required" is unchecked for it. Due to this JUnits are failing with the Missing IN or OUT parameter error. If I set the bind variable as required, the JUnits run fine.
    But this bind variable is also used in several view criterias where it is set as Optional. So if I set the bind variable in the view object query as Required, will it affect the view criterias as well?

    check https://blogs.oracle.com/jdevotnharvest/entry/the_infamous_missing_in_or

  • Issue with View object query

    Hi,
    I have extended my controller to add an additional condition to the view object query where I appen an add condition.If there is any kind of exception the add condition keeps on appending without refreshing the query to the orginal one.I have to clear the cache to be able to fix it
    below is the peice of code.What should I do to be able to get the original query or refresh it because when i do a getQuery it keeps giving me the query with the earlier condition that I appended and again appends the new condition.
    strQuery = oaviewobjectimpl.getQuery();
    oaviewobjectimpl.setQuery(strQuery+" AND MtlCategoriesKfv.CONCATENATED_SEGMENTS = '"+strCategory+"'");
    RequisitionAMImpl requisitionamimpl1 = (RequisitionAMImpl)oapagecontext.getApplicationModule(oawebbean);
    OAViewObjectImpl oaviewobjectimpl = requisitionamimpl.getReqCategoryVO();
    String strQuery = oaviewobjectimpl.getQuery();
    oaviewobjectimpl.setQuery(strQuery+" AND MtlCategoriesKfv.CONCATENATED_SEGMENTS = '"+strCategory+"'");
    oaviewobjectimpl.setWhereClauseParams(null);
    oaviewobjectimpl.setWhereClauseParam(0, oapagecontext.getCurrentLanguage());
    if(oapagecontext.isLoggingEnabled(1))
    oapagecontext.writeDiagnostics(this, "oaviewobjectimpl.getQuery() "+oaviewobjectimpl.getQuery(), 1);
    oaviewobjectimpl.executeQuery();
    oaviewobjectimpl.last();
    if(oapagecontext.isLoggingEnabled(1))
    oapagecontext.writeDiagnostics(this, "oaviewobjectimpl.getFetchedRowCount() "+oaviewobjectimpl.getFetchedRowCount(), 1);
    ReqCategoryVORowImpl reqcategoryvorowimpl= (ReqCategoryVORowImpl)oaviewobjectimpl.first();
    Number categoryId = reqcategoryvorowimpl.getCategoryId();

    user610276 ,
    Y don't u make a custom VO, as you are doing set query, i expect ur changing entire query of seeded VO, better to use custom VO here and attach it to required beans progrmatically.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Changing focus line in List View object?

    Hi -
    I have an list view object on my dashboard that displays about 50 lines of data, with the very first line being a total line. You can drill-into the any one item on the list view to see detail in another chart. The content of the list view is updated when the date range is change from current month to previous month.
    My question is this: if I select the 5th line item in the list view then change the date range, the list view retains the focus on the 5th line even after it is updated - so is it possible to force the list view to change the focus to the 1st line everytime the date range changes?
    I am guessing no because I see nothing in the properties of the list view that allows you to control focus.
    Thanks in Advance!

    Melissa,
    No there is no option as such in the component. May be you can use the Reset button component.
    -Anil

  • Need help on how to specify the current select row in a View Object

    Hi,
    I have a ADF table on my page, when I was selecting the rows in this table, I want the set and get methods in the ViewRowImpl class to do some customized actions. I found out that each time regardless the row I select in the table, the viewrowimpl class will always return the data in the first row, I tried to use getCurrentRow in VO row impl. but still, gets the first row.
    Does anyone know how to get the selected row value in the View Object, or View Row Impl rather???
    Thanks!

    Hi,
    you can call a method exposed by the AM and pass teh rowKey of the selected row as an argument. When you configure the exposed AM method in the pageDef (creating a method binding) the argument is shown in a dialog from where you can use EL like #{bindings.iteratorName.currentRow.rowKey} to access the current selected row.
    Frank

  • How to bind a user selected value to a view object bind variable?

    Hi
    I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
    when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
    to display the columns i have used the query
    Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
    now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
    thanks
    swathi.

    Hi,
    depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
    Frank

  • How to not have your view objects query before the page comes up?

    Hello. I have a view object that is part of a LOV. This view object always gets queried on bringing up the page (I need it to happen on the LOV click) How can I have the VO not queried initially? I tried setting the Iterator to refresh never, but it still does it. Here's the log before the page comes up:
    [363] BindingContext.put( ContactsAMDataControl@irepair_DataBindings_cpx, oracle.jbo.uicli.binding.JUApplication )
    [364] Resolving VO:ContactsVVO1 for iterator binding:ContactsVVO1Iterator
    [365] Changing iterator range size from :1 to :25
    [366] ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [367] Column count: 13
    [368] ViewObject: ContactsVVO1 Created new QUERY statement
    [369] ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [370] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [371] Bind params for ViewObject: ContactsVVO1
    [372] DCUtil, returning:oracle.adf.model.binding.DCParameter, for ContactsAMDataControl
    [373] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [374] Column count: 13
    [375] ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 Created new QUERY statement
    [376] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [377] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [378] Bind params for ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1
    Thanks!
    Edited by: user621288 on Jun 17, 2009 4:11 PM

    There are two ways:
    1. Uncheck "Query List Automatically" under List UI Hints in the view object overview xml.
    2. In the query add "where 1=:bnum and 1 is not null" and execute the query in the LaunchPopupEvent
        public void userIdId_launchPopupListener(LaunchPopupEvent launchPopupEvent) {
            DCIteratorBinding myListIter = (getItrtBindings("MyLovViewObj1Iterator"));
            ViewObject vo = myListIter.getViewObject();
            NavigatableRowIterator myItemList = myListIter.getNavigatableRowIterator();
            Row row = myItemList.first();
            Object[] val = row.getAttributeValues();
            ViewRowSetImpl vor = (ViewRowSetImpl)val[row.getAttributeCount() - 1];
            vor.setNamedWhereClauseParam("bnum", new BigDecimal(1));
            vor.executeQuery();
        }

  • Pass parameter from jsf to view object query

    Hi,
    i have requirement where user id is captured when user logs in in a session bean.How do I pass this parameter to bind variable in query?
    thanks,
    Mat

    Amit's second link : Setting bind variable for a view object
    should hold answers for you.
    Ypu can also visit : http://groundside.com/blog/DuncanMills.php?title=adf_executing_code_on_page_entry_1_servi&more=1&c=1&tb=1&pb=1
    The general idea is this :
    Get the username (you mentioned portal, so after portal authenticates the user is the username available in a session scoped managed bean ? You would need to access this somehow because your query needs it., preferrably by EL)
    create am AM method to set the bind parameter to the Vo and execute it. The method is automatically exposed to the DataControl.
    Create a method binding in your page def for the method. in the parameters for the method, use the EL to get the username, eg: #{sessionScope.frameworkBean.username} (you could also create a binding for executeWithParams, but I hav'nt done this in a while and dont remember the exact process )
    Now create an executable for the method binding you created. (the executable ensure that this method is called at pageload, and set you refresh condition appropriately)
    Go to the properties
    Edited by: Jeevan Joseph on Jan 13, 2011 2:44 PM

  • ADF View Object query to use Oracle  LONG data type

    Hi,
    I'm using a view object that uses Oracle LONG data type.The following exception is thrown
    *"java.sql.SQLException: Stream has already been closed"* and it is not fetching the correct data.
    I have searched in many forums,they suggested to use LOB instead of LONG as LONG is deprecated. But in my case I can't avoid using LONG as some of my legacy applications using the same DB.
    Please suggest me a way
    Thanks in Advance
    Felix

    Thanks for your reply Arun,
    I have solved this problem using the solution suggested by this blog [AskTom-Link|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582]
    In the above blog link,they have suggested to convert Long to Varchar by functions and asked to use this function in the column.
    Thank you all guys who have seen this post.
    Regards,
    Felix

  • SetCurrentRowWithKeyValue - Does this execute View Object Query twice?

    Hi,
    I have a View Object for which on the prepare model of the page definition I am executing the setCurrentRowWithKeyValue action.
    In the log I see two queries being printed one with Bind Variable of the Key value that I have passed and right next to that I see one more query for the same view object that gets executed without any where clause.
    This causes the View Object to execute an open query which is causing performance issue.
    Any help/Insight on this problem is greatly appreciated.
    Thanks,
    Kumar K.

    Thanks for the response.
    Solution provided in the thread doesn't prevent the execution but it will not return any rows..But I am just curious to know that is there some thing different done while using setCurrentRowWithKeyValue?
    Why should it execute query twice once with Bind variable and next time without the bind variable?
    Kumar K.

  • Inconsistent view object result set  (REPOST ... no response since 23/07/2002)

    (1)In JSP front-end, I have the following code:
    <%
    ComUtil c = new ComUtil();
    String sAppConfig = c.getAppConfigStr();
    %>
    <jbo:ApplicationModule id="am" configname="<%=sAppConfig%>" releasemode="Stateless" />
    // A datatag is put here to print out a combo box for user selection with all places defined in table
    <MyTagLib:PrintSelectForAllPlaces strTagName="v_CheckPlace" strAmId="am" blnDisplayHyphen="false" />
    <jbo:ReleasePageResources />
    (2) The ComUtil.getAppConfigStr() code is as follows:
    // Configurations parameters
    String _cfPkg = "MyPkg"; // Configuration package name
    String am = cfPkg + ".MyAppMod"; // Fully-qualified application module name
    String _cf = "MyPkgAppModLocal"; // Configuration name for connection info
    String IP_ADDR = "xxx.xxx.xx.xxx"; // x stands for number
    String SID = "MySid";
    String PORT = "xxx"; // x stands for number
    /** Connection string used by front-end JSP for Jbo to obtain configuration name for
    an application module **/
    public String getAppConfigStr () {
    // Create an instance of the application module by name, using local mode
    String sAppConfigStr = am + "." + cf;
    return sAppConfigStr;
    (3) My data tag code:
    public class PrintSelectForAllPlaces extends TagSupport {
    public int doStartTag() {
    ViewMyPlacesRowImpl r = new ViewMyPlacesRowImpl();
    ComUtil c = new ComUtil();
    ApplicationModuleRef amRef = Utils.getAMRefFromContext(pageContext, strAmId);
    ApplicationModule am = amRef.useApplicationModule();
    JspWriter out = pageContext.getOut();
    try {
    ViewObject vo = am.findViewObject("ViewMyPlaces");
    if (vo != null) {
    vo.executeQuery();
    int j = 0;
    out.println("<select name=" + strTagName + " " + strActionList + ">");
    if (blnDisplayHyphen) {
    out.println("<option value = '' selected>--</option>");
    while (vo.hasNext()) {
    r = (ViewMyPlacesRowImpl)vo.next();
    String sPlaceCode = (String)r.getPlaceCode();
    String sPlaceDesc = (String)r.getDescription();
    out.print("<option value = '" + sPlaceCode + "' ");
    System.out.println("sPlaceCode: " + sPlaceCode);
    if (strDefaultValue != null) {
    if (strDefaultValue.length() > 0) {
    if (sPlaceCode.equals(strDefaultValue)) {
    out.print("selected");
    out.print(">");
    out.print(sPlaceDesc);
    out.println("</option>");
    out.println("</select>");
    } else {
    out.println("View object not found! ");
    } catch (JboException je) {
    je.printStackTrace();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    return SKIP_BODY;
    My question:
    - When i run my jsp, sometimes 2 rows are retrieved, sometimes 3 row are retrieved, sometimes all are retrieved, which can be simulated by 'Refreshing' the jsp page. I feel quite upset as this affects my whole application seriously. Would anyone give me any idea about my case?
    (I have tried to re-make and re-compile the project; synchronizing my table structure; and also tried vo.clearCache(); but still no use. Moreover, The retrieved resultset supposed to be a reference table which will not change frequently, which means that caching is not serious affected.)
    My case is quite urgent to me. In case of any ideas, please don't hesitate to let me know.
    Thanks a lot for your replies!

    Dear Shailesh, would you please give me some guidelines for how to generate diagnostic outputs for BC4J? I don't know how to run the function, which may be very helpful for debugging. ^v^
    Regarding the problem I mentioned, more details are listed as follows:
    1. My mentioned table has 5 rows in total.
    2. My expected result set has 4 rows, which is filtered by the Query statement:
    - SELECT PLACE_CODE, PLACE_DESC FROM PLACES WHERE DISPLAY_FLAG = 'Y';
    3. Why I know the retrieved row is not equal because the program code line in my first post for this topic:
    System.out.println("sPlaceCode: " + sPlaceCode) is embedded in the loop within while (rs.hasNext()). Sometimes the output like this:
    sPlaceCode: PLACE1
    sPlaceCode: PLACE2
    sPlaceCode: PLACE3
    Sometimes like this:
    sPlaceCode: PLACE1
    sPlaceCode: PLACE2
    4. It is in random behavior.
    The situation has been improved after I have 'Test' the BC4J view, that I have navigated all records. Then, the time of displayed all expected records has been increased. Such a mystery ... What I am feeling worried is that, I can't navigate all the time for my reference tables ~~~ besides, it still shows the same problem until now.
    My Requests:
    1. Please give me the guidelines for generating the diagnostic output.
    2. Please help to investigate my mentioned problem.
    Thanks so much for your help and replies!

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

  • Expert mode query in View objects and appended where clause

    My company is Oracle Member Partner and we are developing enterprise web applications using Oracle database and BC4J.
    I have the following problem...
    When I enable EXPERT MODE option in View Object I have trouble appending to query statement in my client code.
    I need expert mode because I must use "SELECT DISTINCT" insted of "SELECT" in my query.
    It looks something like this:
    viewObject.setWhereClause("CLA_ID = " + claId);
    viewObject.executeQuery();
    SQL query from View Object becomes sub-query and fails to execute:
    select * from (original view object query) where (... appended where clause)
    Order by part of the query causes sql errors because original query is now sub-query.
    Is there any way around this?

    I tried creating an expert mode SQL query:
    SELECT DISTINCT EMPNO, ENAME FROM EMP.
    Then at runtime I do:
    vo.setWhereClause("ENAME LIKE '%'||?||'%');
    vo.setWhereClauseParam(0,'A');.
    and this works fine. The trick is that since expert-mode view objects get wrapped as inline views (to allow runtime appending of WHERE clause, actually), you need to select any column in the select statement to which you want to later refer in a dynamically-appended where clause.
    If you want to prevent the inline-view wrapping, you can write the following code in your view object's ViewObjectImpl subclass to force the VO to NOT be treated as an expert-mode SQL VO.
      // Goes in your view object impl subclass
      public void create() {
         // Force this VO to NOT be treated as an expert-mode SQL, so that
         // its query does not get wrapped as an inline view.
         getViewDef().setFullSql(false);
      }I used this trick above to create an expert mode query like:
    SELECT DISTINCT deptno FROM empand then at runtime I add a dynamic where clause that refers to a column
    in EMP that is not in the select list like this:
        ViewObject vo = am.findViewObject("View1");
        vo.setWhereClause("ename like '%A%'");
        vo.executeQuery();
        System.out.println(vo.first().getAttribute(0));and this causes the query to come out as:
    SELECT DISTINCT deptno FROM emp WHERE ename like '%A%'.
    instead of:
    SELECT * FROM (SELECT DISTINCT deptno FROM emp) QRSLT WHERE ename like '%A%'which would cause an error due to the fact that ename is not in the select list of the original (wrapped, inline) query.

  • Problem exposing Accessor Methods on View object (ViewRowImpl.java)

    JDeveloper 9.03
    I have a view link, ViewLinkSourceDest, that links two view objects Source and Destination. Each view object has its respective ViewRowImpl.java file created.
    I have selected "Generate Accessor in View Object" in View link Properties of the View Link Wizard for both source and destination view objects.
    The correct Accessor methods are available in both the source and destination ViewRowImpl files.
    When I access the Source accessor method from the DestinationViewRowImpl object I receive the following error:
              ORA-00904: invalid column name
              It is also is displaying the Source view object's SQL statement with the (:1 = Destination.ID) where clause.
    The error is occurring when trying to retrieve the view object using this type of method call:
              Row r = this.getSourceView();
    After further investigation I have found an example set of view objects in which the error does not occur. The difference was in the ViewLink.xml file.
    The ViewLink.xml file that accesses the Accessor with the error begins like this:
              <ViewLink     
                   Name="ViewLink"
                   Where=":1 = Destination._ID" >
    The ViewLink.xml file that accesses the Accessor with no error begins like this:
              <ViewLink     
                   Name="ViewLink"
                   EntityAssociation ="SourceDestAssociation" >
    suggesting that the use of an association would resolve this problem.
    I was not able to create a View link based on an association that would generate a ViewLink.xml file that ressemble the successful file above. I could however manually add the correct entry to the xml file that caused the error and sucessfully access the Accessor method in the source object. This is not the final answer because the IDE will regenerate the ViewLink.xml file to its original state even if created with the appropriate Association.
    Is this a bug?
    Is the way the ViewLink.xml file created different in JDev 9.03 than in 9.02
    Is there something I am missing that is causing the ViewLink.xml file to generate incorrectly?
    Any suggestions would be helpful.
    Rob

    Steps to recreate:
    1 Create SomeSuperEntityImpl.java extended by SourceEntityImpl.java and DestinationEntityImpl.java entity objects.
    2 Create SourceView and DestinationView objects
    3 Create SourceDestinationAssociation linking the entity object Source PK to Destination FK
    4 Create SourceDestinationView linking Source and Destination view using the SourceDestinationAssociation
    View the SourceDestinationView.xml file and you will see that the viewlink has Where=":1 = source.src_id"
    This is the scenario that causes the initial problem with the Accessor Methods.
    If the SomeSuperEntityImpl.java is removed as the super class and the same procedure is followed you will get the desired 'EntityAssociation = "package.SourceDestinationAssociation"' in the SourceDestinationView.xml file .
    Hope this is a little clearer.
    Rob

Maybe you are looking for

  • Is it possible to change the color of the main toolbar and tabs in Safari?

    I was wondering if there is a way to change the color of the gray toolbar/tabs in Safari? Thanks.

  • 10g Installation on OSX errors in invoking

    Hello, I ran into some serious "Error in invoking target..." errors during the installation of 10g on OSX 10.3.8, which lead to a completely useless Oracle. Have you guys had the same problems? The first one was because of a directory that didn't exi

  • PIN's

    can i as an american blackberry user PIN a canadian blackberry user? meaning i live and purchased my blackbery in the US and my friend in canada.

  • Story Markers not obeying end jump

    Hello. I created a simple DVD with Stories -- 3 tracks each with 3 stories which correspond to the 3 chapters in the specified track. There is a Stories Menu with a button for each Story to 1) Play All (points to the track) and nine buttons, one for

  • How to read data of type lraw in character format

    Hi , I want to read the data of the field CLUSTD ( which is of lraw data type ) of table SOFFCONT1 . It has contents such as FF05020102028000313130300000000017020000121F9D0273CC7C8C4B1818782483B5A7C74CB09FE7E9E7E61FEFEC131A1CE21AB41628B58A81E1FF7A060