Changing a Programmatic View Object's query at run-time

Hi,
I've created a programmatic View Object using the information in '35.9.3 Key Framework Methods to Override for Programmatic View Objects' in the Oracle Middleware Fusion Guide and bound it to a BarChart. This has worked fine using the following:
String myColumn = "Quant1";
protected void create() {
getViewDef().setQuery(null);
getViewDef().setSelectClause(null);
setQuery(null);
String myQuery = "SELECT Service as MyService, " + myColumn + " as MyValue FROM ColumnTestTable WHERE 1 = 1";
getViewDef().setQuery(myQuery);
setQuery(myQuery);
I also have my data updating automatically. I have public properties in my viewObjImpl class which I can set and update the value of myColumn. I then thought it would just be a case of re-calling the create() method and the SQL would be updated and my chart would auto-update using the new column to select it's values, the value of the property updates and the create method is called but the chart doesn't display any different data and stops auto-updating. Does anybody know if this is possible and if so what I may have missed?
Cheers, Tom

Hi Timo,
I moved everything to a different public method and solved the problem by firing the execute() method which I hadn't been doing previously and the chart updates with the correct data.
However, once I execute the SQL my chart stops auto-updating with changes to the data in the database - do you know how I update the SQL query but keep my chart auto-updating? Perhaps I have to re-register for the registerDatabaseChangeListener for the query collection?
Thanks in advance, Tom

Similar Messages

  • View Link on two programmatic view objects

    Hello,
    I use Build JDEVADF_11.1.1.1.0_GENERIC_090615.0017.5407
    I have two programmatic View Objects with data from other sources (an ArrayList in my example).
    Now I would like to create a View Link on it. How can I do this?
    I'm quite new on Java and ADF...
    I know it is possible because I already found Steve's example 132 here [http://blogs.oracle.com/smuenchadf/examples/|http://blogs.oracle.com/smuenchadf/examples/]
    But could somebody create a simple example based on my example classes below (which is understandable for a newbie like me ;-) ?
    Has been asked already here, but I did not found a solution as yet.
    Error with view link and ADF table Tree
    This is my example code for the view objects:
    Employee.java:
    private Number empno;
    private String ename;
    private Number dept;
    with getters and setters...
    Department.java
    private Number deptno;
    private String dname;
    with getters and setters...
    public class StaticDataDepartmentsImpl extends ViewObjectImpl {
    int rows = -1;
    private List<Department> departments = new ArrayList<Department>();
    protected void executeQueryForCollection(Object rowset, Object[] params,
    int noUserParams) {
    // Initialize our fetch position for the query collection
    setFetchPos(rowset, 0);
    super.executeQueryForCollection(rowset, params, noUserParams);
    // Help the hasNext() method know if there are more rows to fetch or not
    protected boolean hasNextForCollection(Object rowset) {
    return getFetchPos(rowset) < rows;
    // Create and populate the "next" row in the rowset when needed
    protected ViewRowImpl createRowFromResultSet(Object rowset,ResultSet rs) {
    ViewRowImpl r = createNewRowForCollection(rowset);
    int pos = getFetchPos(rowset);
    populateAttributeForRow(r, 0, departments.get(pos).getDeptno());
    populateAttributeForRow(r, 1, departments.get(pos).getDname());
    setFetchPos(rowset, pos + 1);
    return r;
    // When created, initialize static data and remove trace of any SQL query
    protected void create() {
    super.create();
    // Setup string arrays of codes and values from VO custom properties
    initializeStaticData();
    rows = (departments != null) ? departments.size() : 0;
    // Wipe out all traces of a query for this VO
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    // Return the estimatedRowCount of the collection
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    return rows;
    // Subclasses override this to initialize their static data
    protected void initializeStaticData() {
    Department d1 = new Department();
    d1.setDeptno(new Number(10));
    d1.setDname("IT");
    Department d2 = new Department();
    d2.setDeptno(new Number(20));
    d2.setDname("HR");
    departments.add(d1);
    departments.add(d2);
    // Store the current fetch position in the user data context
    private void setFetchPos(Object rowset, int pos) {
    if (pos == rows) {
    setFetchCompleteForCollection(rowset, true);
    setUserDataForCollection(rowset, new Integer(pos));
    // Get the current fetch position from the user data context
    private int getFetchPos(Object rowset) {
    return ((Integer)getUserDataForCollection(rowset)).intValue();
    public class StaticDataEmployeesImpl extends ViewObjectImpl {
    int rows = -1;
    private List<Employee> employees = new ArrayList<Employee>();
    protected void executeQueryForCollection(Object rowset, Object[] params,
    int noUserParams) {
    // Initialize our fetch position for the query collection
    setFetchPos(rowset, 0);
    System.out.println("in executeQueryForCollection");
    super.executeQueryForCollection(rowset, params, noUserParams);
    // Help the hasNext() method know if there are more rows to fetch or not
    protected boolean hasNextForCollection(Object rowset) {
    System.out.println("in hasNextForCollection. Rows:" + rows);
    return getFetchPos(rowset) < rows;
    // Create and populate the "next" row in the rowset when needed
    protected ViewRowImpl createRowFromResultSet(Object rowset,ResultSet rs) {
    ViewRowImpl r = createNewRowForCollection(rowset);
    int pos = getFetchPos(rowset);
    System.out.println("in createRowFromResultSet. Pos=" + pos);
    populateAttributeForRow(r, 0, employees.get(pos).getEmpno());
    populateAttributeForRow(r, 1, employees.get(pos).getEname());
    populateAttributeForRow(r, 2, employees.get(pos).getDept());
    setFetchPos(rowset, pos + 1);
    return r;
    // When created, initialize static data and remove trace of any SQL query
    protected void create() {
    super.create();
    // Setup string arrays of codes and values from VO custom properties
    initializeStaticData();
    rows = (employees != null) ? employees.size() : 0;
    System.out.println("in create(). Rows=" + rows);
    // Wipe out all traces of a query for this VO
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    // Return the estimatedRowCount of the collection
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    return rows;
    // Subclasses override this to initialize their static data
    protected void initializeStaticData() {
    Employee e1 = new Employee();
    e1.setEmpno(new Number(2333));
    e1.setEname("Emp1");
    e1.setDept(new Number(10));
    Employee e2 = new Employee();
    e2.setEmpno(new Number(1199));
    e2.setEname("Emp2");
    e2.setDept(new Number(20));
    Employee e3 = new Employee();
    e3.setEmpno(new Number(3433));
    e3.setEname("Emp3");
    e3.setDept(new Number(10));
    Employee e4 = new Employee();
    e4.setEmpno(new Number(5599));
    e4.setEname("Emp4");
    e4.setDept(new Number(20));
    Employee e5 = new Employee();
    e5.setEmpno(new Number(5676));
    e5.setEname("Emp5");
    e5.setDept(new Number(10));
    Employee e6 = new Employee();
    e6.setEmpno(new Number(7867));
    e6.setEname("Emp6");
    e6.setDept(new Number(20));
    employees.add(e1);
    employees.add(e2);
    employees.add(e3);
    employees.add(e4);
    employees.add(e5);
    employees.add(e6);
    // Store the current fetch position in the user data context
    private void setFetchPos(Object rowset, int pos) {
    if (pos == rows) {
    setFetchCompleteForCollection(rowset, true);
    setUserDataForCollection(rowset, new Integer(pos));
    // Get the current fetch position from the user data context
    private int getFetchPos(Object rowset) {
    return ((Integer)getUserDataForCollection(rowset)).intValue();
    Who can help?
    Thnx in advance!
    Rolf

    Rolf,
    I guess when we try to do it for you, we end up with almost the sample code provided by Steve Muench.
    So there from my point of view it doesn't make sense to do it all over.
    Take some time and study the sample code, run it without changes and after that try some changes which suits your use case better.
    If you don't understand what's going on in the sample post the question here and we try to help you.
    Timo

  • View Links for Programmatic View Objects

    Hi All,
    I created a read only VO called MyVO based on a sql query.
    I created 2 programmatic view objects, MasterView and ChildView.
    In a custom method in AMImpl class ,I iterate through this MyVO resultset and get the rows in a Row object.
    Based on some attributes values of the Row, I populate both master and child View Objects.
    I have created a view link between Master and Child Programmatic View Objects and have exposed them in AM.
    Now I run the AM, and run the method exposed in client interface.
    Now I click on my master and child programmatic views.
    I see that the rows are populated in both of these programmatic VOs.
    But when I click on viewlink which I have exposed under master, it doesnt show me any
    record for child.
    This is my method of AMImpl which is exposed in AM client interface.
    public void constructLines(){
    ViewObject vo= this.getMyVO1();
    ViewObject master=this.getTransientVO1();
    ViewObject child=this.getTransientLineVO1();
    Row r,masterRow,childRow;
    int count=0;
    while(vo.hasNext()){
    ++count;
    r=vo.next();
    masterRow = master.createRow();
    if(r.getAttribute("QuoteHeaderId")!=null)
    masterRow.setAttribute("QuoteHeaderId",
    r.getAttribute("QuoteHeaderId").toString());
    if(r.getAttribute("QuoteLineId")!=null)
    masterRow.setAttribute("QuoteLineId",
    r.getAttribute("QuoteLineId").toString());
    if(r.getAttribute("LineNumber")!=null)
    masterRow.setAttribute("LineNumber",
    r.getAttribute("LineNumber").toString());
    master.insertRow(masterRow);
    childRow= child.createRow();
    if(r.getAttribute("RefLineId")!=null)
    childRow.setAttribute("RefLineId",
    r.getAttribute("QuoteLineId").toString());
    if(r.getAttribute("QuoteHeaderId")!=null)
    childRow.setAttribute("QuoteHeaderId",
    r.getAttribute("QuoteHeaderId").toString());
    child.insertRow(childRow);
    This is stopping me from my development progress.
    Any suggestion to solve this will be of great help.
    Thanks,
    Prabhanjan

    Hi..
    have you define relationship correctly between masterVO and childVO.sometime there may be the problem.

  • Programmatic View Object

    I'm trying to create a programmatic view object from an Oracle Stored procedure that returns a single row containing Oracle Object Types. I created a Domain for my Oracle Object type called BillingInfo. Here is the code for my view object so far:
    package billing;
    import billing.common.BillingInfo;
    import java.lang.Integer;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import oracle.jbo.JboException;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class BillingInfoViewImpl extends ViewObjectImpl
    // billing info procedure call variables
    private final static int BILLING_LOGGED_ON_USER_ID = 0;
    private final static int BILLING_BILL_TO_USER_ID = 1;
    private final static int BILLING_TRANSACTION_DATE = 2;
    private final static int BILLING_TRANSACTION_DETAILS1 = 3;
    private final static int BILLING_TRANSACTION_DETAILS2 = 4;
    private final static int BILLING_TRANSACTION_DETAILS3 = 5;
    private final static int BILLING_TRANSACTION_DETAILS4 = 6;
    private final static int BILLING_TRANSACTION_DETAILS5 = 7;
    private final static int BILLING_TRANSACTION_COUNT = 8;
    private final static int BILLING_TOTAL_CHARGE_AMOUNT = 9;
    private final static int BILLING_PAY_TYPE = 10;
    private final static int BILLING_ERROR_MESSAGE = 11;
    private final static int BILLING_ERROR_CODE = 12;
    private final static int BILLING_RETURN_VALUE = 13; /*
    * This is the PLSQL block that we will execute
    private static final String SQL =
    "begin ecs_jdbc_wrappers.get_billing_info_jdbc(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,?, ?, ?);end;";
    * This is the default constructor (do not remove)
    public BillingInfoViewImpl() { }
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will PRECEED the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params they will be in the 'params' array.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    int sqlcode = 0; // statement sql code
    String errorMessage = null; // statement error message
    String loggedOnUserId = null; // IN VARCHAR2
    String billToUserId = null; // IN VARCHAR2
    Date transactionDate = new Date(); // IN DATE
    BillingInfo transactionDetails1 = null; // IN OUT billing_info
    BillingInfo transactionDetails2 = null;
    BillingInfo transactionDetails3 = null;
    BillingInfo transactionDetails4 = null;
    BillingInfo transactionDetails5 = null;
    int transDetailsCount = 0; // IN INTEGER
    String payType = null; // IN VARCHAR2
    if (params != null)
    loggedOnUserId = (String)params[BILLING_LOGGED_ON_USER_ID];
    System.out.println("USER ID:" + loggedOnUserId);
    billToUserId = (String)params[BILLING_BILL_TO_USER_ID];
    System.out.println("BILLED USER ID:" + billToUserId);
    if (params[BILLING_TRANSACTION_DETAILS1] != null) {
    System.out.println(params[BILLING_TRANSACTION_DETAILS1]);
    transactionDetails1 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS1];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS2] != null) {
    transactionDetails2 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS2];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS3] != null) {
    transactionDetails3 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS3];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS4] != null) {
    transactionDetails4 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS4];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS5] != null) {
    transactionDetails5 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS5];
    transDetailsCount = transDetailsCount + 1;
    payType = (String)params[BILLING_PAY_TYPE];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Set the value of the bind variables
    st.setString(1, loggedOnUserId);
    st.setString(2, billToUserId);
    // Set Transaction Date to todays date
    java.sql.Timestamp sqlTs = new java.sql.Timestamp(transactionDate.getTime());
    st.setTimestamp(3, sqlTs);
    System.out.println("TRANS DATE:" + sqlTs);
    st.setObject(4, transactionDetails1);
    if (transactionDetails2 == null) st.setNull(5, Types.STRUCT, "BILLING_INFO");
    else st.setObject(5, transactionDetails1);
    if (transactionDetails3 == null) st.setNull(6, Types.STRUCT, "BILLING_INFO");
    else st.setObject(6, transactionDetails1);
    if (transactionDetails4 == null) st.setNull(7, Types.STRUCT, "BILLING_INFO");
    else st.setObject(7, transactionDetails1);
    if (transactionDetails5 == null) st.setNull(8, Types.STRUCT, "BILLING_INFO");
    else st.setObject(8, transactionDetails1);
    st.setInt(9, transDetailsCount);
    st.setString(11,payType);
    * Register OUT paramters
    st.registerOutParameter(4, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(5, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(6, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(7, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(8, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(10, Types.DOUBLE);
    st.registerOutParameter(12, Types.VARCHAR);
    st.registerOutParameter(13, Types.INTEGER);
    st.registerOutParameter(14, Types.INTEGER);
    // execute the stored procedure
    st.execute();
    // get the SQLCODE
    sqlcode = st.getInt(13);
    System.out.println("sqlcode returned:" + sqlcode);
    errorMessage = st.getString(12);
    System.out.println("Error Message:" + errorMessage);
    catch (SQLException s) {
    System.out.println("sqlcode returned:" + sqlcode);
    System.out.println("Error Message:" + errorMessage);
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    super.executeQueryForCollection(qc, params, numUserParams);
    This almost works except when I try to print out the attributes I get an error. I beleive I have to override some of the view object framework methods. If so, how do I go about this? Is it the same methods overridden in this example Getting a View Object's Result Rows from a REF CURSOR? http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html
    Nat

    Yes. only difference is that your VO will just have one row in it.

  • Programmatic View Objects + View Links

    Ive constructed some programmatic view objects to grab data from 2 custom java business services (for example: Persons and Addresses). The reasons for them being custom and separate are out of my control.
    I need to easily represent a relationship between these 2 view objects so Ive constructed a ViewLink between them. However I cant figure out exactly what ADF needs from me in terms of method implementations in my ViewObjects?
    When I drop the master data control onto a JSF via a Tree table, it looks as though its not actually filtering the detail rows. I.e. if master is a Person, and detail objects are Addresses, each Person tree node has all Addresses under it. Im assuming this is because the Address ViewObject is programmatic and so ADF doesn't know how to filter the results?
    How can I setup this ViewLink between 2 programmatic ViewObjects such that the ViewLink works like its supposed to?

    Hello,
    Steve Muench´s sample 132 implements what you are trying to accomplish. Inspect the sample and let us know if you have questions about it.
    http://blogs.oracle.com/smuenchadf/resource/examples#132
    Juan C.

  • Is there a way to force a View Object to query the database always?

    Dear All,
    Is there a way to force a view object to always scan the database table to read the latest data?
    Here's my use case.
    I have a page that loads data then I have a button which executes the following code.
    viewObject.setApplyViewCriteriaName("SampleCriteria");
    viewObject.setNamedWhereClauseParam("arg1", "test");
    viewObject.executeQuery();
    RowSetIterator it = viewObject.createRowSetIterator(null); 
    while(it.hasNext()) {
         /* More Code */
    }Suppose after page load, I edited some row in the table and then I clicked the button. I notice that my edited row
    was not reflected in the query.
    I am not sure but is there some configuration to check so that when the viewobject executes it will always query the data
    from the table?
    I am thinking that there is some level of caching and I want to disable it. If I restart my application, I notice that it is able to read the latest data.
    JDEV 11.1.1.5

    By default a view object performs its query against the database to retrieve the rows in its resulting row set. However, you can also use view objects to perform in-memory searches and sorting to avoid unnecessary trips to the database.
    The view object's query mode controls the source used to retrieve rows to populate its row set. For more details please refer: http://docs.oracle.com/cd/B31017_01/web.1013/b25947/bcadvvo005.htm
    Also, see if this helps: setQueryMode for secondary rowSet not working

  • Issue in programmatic view object.

    Hi,
    I am creating a programmatic view object, in a button's action listener. I have used ViewObject.clearcache() to flush the VO previous data, every time the button is clicked and load new data. The issue which i face, is that the table showing the VO data, shows data in alternate attempts i.e. 1st,3rd and 5th button click and in the 2nd, 4th click it shows "No data to display." . If i try using ViewObject.reset() the table is loaded with data every time but the new result set gets appended, which gives duplicate data.
    Please help.
    Regards,
    Max

    Hi Navaneeth,
    The code snippet is :
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dciterator=bindings.findIteratorBinding("AccountSummaryMCANViewObj1Iterator");
    ViewObject serviceVO=dciterator.getViewObject();
    webGetVruxDataService = new WebGetVruxDataService();
    WebGetVruxDataPortType webGetVruxDataPortType =
    webGetVruxDataService.getWebGetVruxDataPort();
    Map<String, Object> requestContext =
    ((BindingProvider)webGetVruxDataPortType).getRequestContext();
    requestContext.put(BindingProvider.USERNAME_PROPERTY,
    "ladwpcom");
    requestContext.put(BindingProvider.PASSWORD_PROPERTY,
    "0bama8");
    System.setProperty("javax.net.ssl.trustStore",
    "/webdata/Oracle/Middleware/user_projects/domains/ladwp-test/security/cacerts");
    ObjectFactory objFact = new ObjectFactory();
    HostBridgeVruxRequestCt reqct =
    objFact.createHostBridgeVruxRequestCt();
    String autoPayment = "";
    if(serviceVO!=null)
    serviceVO.clearCache();
    for (int i = 0; i < canCount; i++) {
    // System.out.println(i);
    reqct.setCAN(userCANArray);
    serviceVO.insertRow(serviceVO.createRow());
    Row serviceVORow=serviceVO.getCurrentRow();
    HostBridgeVruxResponseCt responseCT =
    webGetVruxDataPortType.webGetVruxDataOperation(reqct);
    String acctName = responseCT.getVrux().getACCTNO();
    serviceVORow.setAttribute("ACCOUNTNAME", acctName);
    Double currBalance =
    Double.parseDouble(responseCT.getVrux().getTotalPendingAmount().toString());
    serviceVORow.setAttribute("CURRENTBALANCE", currBalance);
    //TODO code for date
    String dDate = responseCT.getVrux().getCDATE();
    String dMonth = dDate.substring(0, 2);
    String dDay = dDate.substring(2, 4);
    String formatteddate = dMonth + "/" + dDay;
    String dueDate = formatteddate;
    serviceVORow.setAttribute("DUEDATE", dueDate);
    if (responseCT.getVrux().getBANKFLG().equals("2")) {
    autoPayment = "Enrolled";
    } else {
    autoPayment = "Not Enrolled";
    serviceVORow.setAttribute("AUTOMATICPAYMENT", autoPayment);
    // System.out.println(serviceVORow.getAttribute("AUTOMATICPAYMENT"));
    serviceVORow.setAttribute("PAYNOW", "");
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.mcANTable);
    Regards,
    Max

  • ViewLink between DB and Programmatic View Objects

    Im using programmatic view objects as described in #132 of http://blogs.oracle.com/smuenchadf/resource/examples
    I can create view links between these programmatic view objects, but when I create a ViewLink from a DB ViewObject to a programmatic view object, the programmatic one fails to see the view link when invoked, and therefore doesnt return the correct detail objects.
    Has anyone created a view link like this before? If so, can I see the code or an example?

    If you look at example #132 above, you'll see a ListOfMapsDataProviderViewObjectImpl - which is a custom ViewObject that delivers data programmatically. There's a method in this object "getFilterCriteria(..)" that looks at the parameters delivered to the ViewObject, and any ViewLinks, to produce a map of parameters that the underlying DataProvider can use to filter its data. When you setup a ViewLink between two of these ViewObjects you may see a filter on a foreign key, since the master view object is retrieving its detail objects. However, when the master object is a standard database view object, the view link doesnt work, i.e. the getFilterCriteria method does not see the view link when it calls ViewObjectImpl.getViewLinks().

  • How to set vo query at run time

    Hi,
    Is it possible to bind the where clause of query at run time.
    N :)

    Hi,
    Yes its possible.
    To add new where clause to your query.
    vo.setWhereClause(null);//If you want to remove any existing programmatically added where clause.
    vo.setWhereClause("Your new query");
    To bind varibales (Say there are 2 bind variables),
    First way to achieve this.
    setWhereClauseParam(null); //Always reset it to remove existing bindings)
    setWhereClauseParam(0, "Your first paramter value"); // Second parameter "Your first paramter value" is of type object.
    setWhereClauseParam(1, "Your first paramter value");
    In case you use "?" styly type binding, this count in above method starts with 1 instead of 0.
    Second way is to put all bind variables in an object array and pass to above method.
    Vector params=new Vector(2);
    params.addElement("FirstParameter");
    params.addElement("SecondParameter");
    Now call vo.executeQuery() to fetch the results as per new query.
    Abdul Wahid

  • Change the database log on parameters in the run time with CR10 Delphi2007?

    Hi,
    I'm using crystal report 10 and Crystal VCL for Delphi. How can I change the database log on parameters in the run time?

    You have to use the ConnectBuffer. See [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note for details.
    Also, consider searching the notes database:
    https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true
    The search; VCL database crystal, returns a number of notes that may be of use.
    Ludek

  • How to change html style titles of a JTabbedPne at run time??

    hi,
    how to change html style titles of a JTabbedPne at run time??
    setTitleAt is not working...

    You can't change the canvas at runtime. But you can put the scrollbar on a stacked canvas and then show or hide that stacked canvas on different canvases.

  • How to get report (SQL Query) generating Run Time

    There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
    Kindly share your experience to get such kind of query in you working time.
    thanks

    Here i try to explain contain of query.
    Parameter
    P_DEPTNO = 10
    P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
    SELECT * FROM EMP
    WHERE DEPTNO = P_DEPTNO
    &P_WHERE_CLAUSE
    REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
    SELECT * FROM EMP
    WHERE DEPTNO = 10
    AND EMPNO IS NOT NULL AND SALARY > 100
    Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
    thanks

  • 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 transient query object question

    One of the view object attribute is based upon a sql query as follows:
    Select count(*) from TABLE where TABLE.customer_id=<The customerId in each column returned>
    How do I configure this transient attribute?
    Thanks.

    Not sure what the exact requirement of this functionality is, but you can also get the size of the result by coding up something similar to the following:
    Build a generic read only vo with the sql like:
    select * from Employee
    Now use either ViewCriteria based search, bind variable or findByKey() method to filter for targeted match. for example using the programmatic bind variable method:
    ViewObject employeeVo= findViewObject("EmployeeVo");
    employeeVo.setWhereClause("ID=:id");
    employeeVo.defineNamedWhereClauseParam("id", null, null);
    employeeVo.setNamedWhereClauseParam("id", someid);
    employeeVo.executeQuery();
    long numberOfMatches = employeeVo.getEstimatedRowCount();
    Hope that helps.
    -Z

  • Changed SQL in view object causing problems

    Hi,
    I'm using Jdev 10.1.3.2, oracle 10g, and ADFBC.
    I created a view object by joining three tables and selecting attributes from them in the select clause. Later, I didn't want some of them, so I commented them out in the sql statement. Now when I query the data using either the application module tester, or run a page with the table on it, the data is not returning in the correct columns. For instance my row attribute #{row.UPC} is showing a number from an entirely different column. I looked at the xml, and rowImpl java files and could not find anything that looked wrong, except that the columns I commented out were not showing up with the values indicating that they were transient as outlined in section 6.10.2 of the ADF developers guide for forms/4gl developers, ie column type = $none$ and no table name attribute. I don't know if they should show up that way or not since they do come from a table, but aren't being used at the moment.
    I've checked the froums, just f'n googled it, and checked the dev guide but didn't find anything, so I was hoping someone on here had the same problem. If there is anything else I could post to help, please let me know, though none of it is custom code, and my sql is extremely simple.
    Thank you,
    Eric Liskow

    Well, I didn't find a solution, but I deleted the transient values, redid the view object, and started a new page and it worked. I'd still like to know if anyone knows what happened though. If I have to do that in a production site soon it wouldn't be much fun!

Maybe you are looking for

  • Whats the best way to get 3GS screen repaired?

    I have had my phone for a week and the screen has cracked all the way a across the phone. It is just the glass not the LCD, but Apple wants $199 to fix it and that's what I paid for the phone. I have had a BB Storm since they came out and have litera

  • Autofill problem, Please Help!!

    I recently had to purchase a new MacBook Pro. Never had this problem before. My personal email starts with PS. I have a contract that everything starts with PS and each time I type this letter combo it autofills my email address. Sometimes a bubble a

  • Photo Email problem

    I recently downloaded Photo Email and purchased the templates, but when I send an email I get the MSG that my email address and/or password are invalid.  It's the address and password I use for my Apple ID. - what could be my problem?

  • Difference between garage band on appstore and bundled version

    Hi to everybody, does anyone know what's  the difference between  the version of garage band on app store and the one I have found already installed on my mac mini? Version number is the same.. I wonder if I pay for more functions or sounds. Thank yo

  • Long running clear jobs

    Hi, we have been unable to use the BPC Clear and Clear from FACT table packages for many of our clears because they run for too long.    In these situations, we delete the records from the FACT, FAC2 and FACTWB tables using a SQL delete statement and