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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

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

  • Major Issues with views in A3

    I am having some major issues with views in A3.
    If you look at my screenshot I am in the Browser;GRID view, however many of my images are out of view to the right (should be 26). There is no way to see them or select them. Also note that there is no SIZE control on the bottom right!
    If i view it in LIST mode, all my images show up. If I go to FULL SCREEN everything works like it is suppose to. It just happens in
    http://farm5.static.flickr.com/4007/4354751139647d87b323b.jpg
    Any ideas on how I can fix this?

    If I go into split view, I do not get any scroll bars so there is no way of viewing all my images.

  • Captivate 8 - How to change to producing "project.json" file instead of a "project.txt" file?  Having issues with viewing published projects due to this.

    Captivate 8 - How to change to producing "project.json" file instead of a "project.txt" file?  Having issues with viewing published projects due to this.   Would be thankful fo rany/all advice.

    I'm having the same issue. I've been able to work around it by opening the txt file and copying the contents. Then I open a new file in Sublime Text 2, paste the contents and save the new file as "project.json". It seems to work, but it'd been nice if I didn't have to do this everytime I publish a new project.

  • Query By Example with view object - how?

    Hi all,
    I have a named query "select new model.vo.PatientVO(o) from Patient o", how to write this using Query By Example?
    Entity Patient has complex structure, so PavientVO (we call it "view object", I don't know the official term for this), which is very simplified Patient, is used for displaying the basic data.
    I guess I would still use Patient as example object, but how to tell the query framework to return PatientVOs?
    Thanks,
    Pedja

    You would need to use a ReportQuery with the example object, and add a constructor item to the ReportQuery.
    You could also just use a regular ReadAllQuery and wrap the Patient objects with your PatientVO after.
    James : http://www.eclipselink.org

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

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

  • Performance issue with Business Objects Java JRC API in CRXI R2 version

    A report is developed using java JRC API in CR XI release 2. When I generate the report in the designer, it took less than 5 seconds to display the results in crystal report viewer inside the designer. But in the QA environment, when I generate the same report from the application, it takes almost 1 to 1.5 minutes to display the same results in PDF. I also noticed that if the dataset contains bigger volume of data, then the reports are taking even longer almost 15 to 20 minutes.
    While generating the report from the application, I noticed that most of time is taken during the execution of the com.crystaldecisions.report.web.viewer.ReportExportControl Object method as shown in following line of code
    exportControl.processHttpRequest(request, response, context, null)
    We thought the delay in exporting the report to PDF might be the layout of the report and data conversion to PDF for such a bigger volume of data.
    Then we investigated the issue and experimented quickly to generate the same report with same result set data from the application using XML, XSL and converted the output XSL-FO to PDF using Apache FOP (Formatting Objects Processor) implementation. The time taken to export the report to PDF is less than 6 seconds. By doing this experiment, it is proved that the issue is not with conversion of data to PDF but it is the performance problem with Business Objects Java JRC API in CR XI R2.
    In this regard, I searched for the above issue in the SAP community Network Forums -> Crystal Reports and Xcelsius -> Java Development -> Crystal Reports. But I did not find any answers or solutions for this kind of issue in the forums.
    Any suggestion, hint in this matter is very much appreciated.

    Ted, The setReportAppServer problem is resolved. Now I could able to generate the report with hardcoded values in the SQLs in just 6 seconds where as the same report was generated in CRXI R2 in 1 minute 15 seconds as mentioned in the earlier message.
    But, our exisiting application passes the parameter values to the SQLs embedded in the report. For some reason the parameters are not being passed to the report and the report displays only the labels without data.
    As per the crj 12 samples codes, the code is written as shown below.
    1. Created ReportClient Document
    2. SetReportAppServer
    3. Open the report
    4. Getting DatabaseController and switching the database connection at runtime
    5. Then setting the parameters as detailed below
    ParameteFields parameterFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
    parameterFieldController.setCurrentValue("", "paramname",paramvalue);
    parameterFieldController.setCurrentValue("", "paramname",paramavalue);
    byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF); 
    6. Streaming the report to the browser
    Why the parematers are not being passed to the report?  Do I need to follow the order of setting these parameters?  Did I miss any line of code for setting Params using  crj 12?
    Any help in this regard would be greatly appreciated.

  • Issue with viewing SAP Dashboards Portal iView in iPad Safari browser (Mobile)

    Hi,
    I am facing an issue while viewing iViews hosted in SAP Enterprise Portal. I have two iViews -
    1) An SAP BICS Dashboard - Published as an iView in EP. I can see the dashboard in my laptop running properly. It consumes BEx queries (BICS dashboard) in the background.
    2) A BEx query published as an iView (java web format), also able to run and execute from my laptop.
    When I am logging into the portal from IPad Safari web browser I am able to see and run the BEx query iView published in the portal.
    However, for the SAP Dashboard iView, it is showing me a blank page after loading. Is it possible to see SAP BICS Dashboard through an iView in Ipad?
    I need to run the dashboard iView from the IPad as well. It is an urgent requirement
    Would really appreciate your help!!
    Thanks,
    Debtanay
    Message was edited by: Anja Engelhardt

    Hi,
    Don't spend your time to find the reason.
    BI platform content is not supported directly in Safari on iPad or Chrome on Android, only through the Mobile BI apps on these platforms.
    Please see PAM chapter "SAP BusinessObjects BI Platform 4.1 Mobile Clients supported with this release"
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/507d3365-009b-3010-04b0-e5abc8f00c91?QuickLink=index&overridelayout=true&59407987714033
    Best regards,
    Roman

  • Weblogic 10.3.0 issues with remote object calls.

    All:
    I was wondering if anyone has experienced any issues with Weblogic 10.3.0 dropping initial remote object calls over AMF Secure Channel. Here are the issues we are experiencing.
    1.     FLEX applications fail consistently on the first remote object call made across the AMF Secure Channel. Resulting in the request not returning from the application server; which has had varying affects on the different applications including missing data, application freeze and general degrading of the user experience.
    2.     FLEX applications require a browser/application refresh once the application has been inactive for a certain period of time. In our experiences the behavior occurs after 30 minutes of inactivity.
    I've deployed this same code to Weblogic 10.3.3 and the behaviors go away. Are there any patches to 10.3.0 that might take care of this issue that we are not aware of?
    Thanks for you help,
    Mike

    Hello,
    I found the problem. But I needed change the target of all my datasources until discover that one of my datasource didn´t answer and no errors was trigged.
    My server was waiting this datasource, and not get started.

  • Issue with viewing website in internet explorer

    Hello.  I created a website in dreamweaver using rollover images for the links.  When I load the webpage in the firefox, google, or opera browsers it loads fine, however when I load it in internet explorer I get an "allow activex" message.  When I tried to view it on my tablet in google it loaded fine, but when I tried to load it in my tablet using internet explorer it didn't show any links at all and than it crashed the browser.  What can cause this and how can I fix it?  is there a better way to create rollover images that I'm not aware of?  I tried to use CSS code in the stylesheet to make rollover images, but couldn't figure out how to do that.
    Thanks,
    Mike Irvan

    Any server you have access to would work fine, you just upload to a temporary folder, like TEST, then delete it after the problem is found.
    However, if you're not online yet, and having issue with IE, it's very likely you just need to drop IE's security settings to allow it to display local file attachments correctly (yeah, don't ask, it's a Microsoft thing).
    Go into IE and choose Tools > Internet Options > Security and drop the scrubber bar down a notch or two, restart and try again.
    When the site is uploaded to an actual server, that error won't come up because all files are coming from the same remote source (Microsoft, it doesn't have to make sense®)
    You can do a search online to get more info on customizing the settings manually, somehting like this page will come up if you search allow blocked local files: IE 10 is blocking javascript on local html files - Microsoft Community

  • 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

  • Issue with Saving the Query output data in Excel format

    Hi,
    Recnetly we had upgraded from 4.6c to ECC 6.0.
    In ECc 6.0 environment, when user try to export the query output , we are getting only XML option to save the data.
    But user want to save the data in EXcel format, he was able to do that in 4.6C.
    pleas eprovide some inputs, on this issue.
    Thanks,
    Sanketh.

    I cannot for the life of me imagine, why a link to a post in the 'Business One Forum' where one uses ODBC to transfer query-data to MicroSoft Excel is of relevance to the OPs question, even if the same is not a security issue.
    Never mind. [note 40155|https://service.sap.com/sap/support/notes/402155] deals with various symptoms in the ALV-Excel combination as as of release 4.6C. There are various others, mostly in components BC-SRV-ALV and BC-ABA-LI - also: I remember that when we upgraded from 4.5B to 4.7C there was an issue with Excel-templates -> the solution was in the release notes somewhere. So, in addition to SMP you might want to check the release notes and/or upgrade guide for solutions.
    And yes, moderators ... this is not a security issue, this should go to ECC-Applications/Upgrade.

  • Problem with view object for global variables

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    We are using view object with transient attributes for global variables.
    we defined the view as explained here:
    http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    also we defined one of the attributes as primary key.
    When we start to test our application with disable connection pooling we got some problems.
    sometimes the row in the global view object is deleted.
    (for example after using executeEmptyRowSet on other view object).
    it looks strange, we couldn't fוnd why does it happen.
    Any idea?

    As Timo said, it is very hard to help without source.
    Are you sure that you do the next step:
    After the call to super.prepareSession(), add code to create a new row in the transient view object and insert it into the view object.

Maybe you are looking for

  • Is it possible to embed query data in javascript at page generate time?

    I have a tabular form and I'd like to add a text field onclick event that uses a query column value in the javascript code. Note: I don't want to refer to an html element value. In PL/SQL Server Pages code I'd just put <%= cursorname.columnname %> in

  • When to use Filestream partitions?

    We have a Web site where we do a lot of document management. We currently have a table with 370,000 records in it. When uploading a new file we check it's size and if it is below 2Gig we store it in a VarChar blob column. We currently want to alter t

  • Oracle server on a desktop

    Does the Oracle server database have a version to operate on a desktop pc? If so, what would be recommended for cpu processor speed, memory and OS? (If I do this, it would most likely be on Windows XP Professional.) I currently have Oracle 9i running

  • Select count into versus create table as in functions/procedures

    I am working on a dynamic PL/SQL script that will count the number of records in a remote database based on certain criteria and then if the number is "acceptable" will create a table in the connecting database with those records. My where clauses ar

  • NavigateToURL behave differently in adove air

    Hi All, I have used navigateToURL in flash to navigate to a dirrerent URL and this works fine in the browser but when I used it with my adobe air application it behave differently. I have used "_SELF" as the target but in AIR, the new URL still open