Group by, setting where clause in View Objects

Hello,
I have a problem with View Objects in BC4j. Cause I cannot use a column in the where clause of a view object that is not also an attribute of the view object, I am unable to group a statement as I want to. Is there a way to solve this problem?
Thanks in advance!
Britta

What version are you using..I tried a simple WHERE clause using an attribute which is not part of the VO and that works ok....
Thanks
Grant Ronald
Oracle Product Management

Similar Messages

  • Where clause in View Objects

    Hi there,
    What is the easiest way to pass a single input parameter from one page to many View Objects with WHERE clause in other pages?
    Many thanks.
    PeeVee

    -When you edit (or create) your bind variable, in the dialog, 'Variable' tab, you have 'Value type' (two radio buttons) as 'Literal' or 'Expression'
    Choose Expression, and set value as
    adf.context.pageFlowScope.whateverAttr
    So take value from pageFlowScope for example. Of course, in order to use that value, you must at first put some value to that scope, for example:
        ADFContext.getCurrent().getPageFlowScope().put("whateverAttr", someValue);
    - where to I set adf.context.sessionScope.whateverSessionAttr MemberId value?-Just as you wrote:
    SELECT ...
    FROM ...
    WHERE WHERE id =: boundedVariable
    - How does WHERE id =: boundedVariable statement really look like. I seem to make it work. Syntax is validated, but the statement error out at run time

  • Modifying where clauses for View Objects in Backing Beans

    In studying the RichTable class I saw no get/set methods that would allow me to manipulate the underlying view instance and rowset for the table in the Backing Bean. I know there is a way to do it, but I having great difficulty in finding it. The tutorials show how to build view objects and display them, but I haven't seen a tutorial that show how to respond to events from the Web page and directly change the data model and what is displayed via the backing bean.
    Can some one point to a tutorial or give me an example on how I can change a view object via a backing bean?

    What you want to do is add a method to your View Object Implementation class that changes the WHERE clause with setWhereClause or addWhereClause. Expose the method to your client. Then call the method from your page by binding it to a commandButton or commandLink. You can bind it through a pageDef file or a backing bean.

  • Programatically set where clause or view criteria not working in managed bean

    I get a view using finditerator then then apply setwhere or view criteria but it does not filter the original rows. code is as follows
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");  // not working
       /*   // not working
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    /* not working
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();

    thanks for reply.
    Jdeveloper version is 11.1.1.4.0.
    Actually the vo on which I am trying to set set where is used as source to act as cursor  to get values from filtered rows using set where and copy the this cursor values to another target vo. I am not showing these source values just getting values.
    DCIteratorBinding dcIter2 =
    ADFUtils.findIterator("PlotDtl2Iterator");     
    ViewObject dvo = dcIter2.getViewObject();
    // colors to copy 
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();
    int totalCount=cvo.getRowCount();
    cvo.setRangeSize(totalCount);
    Row[] rArray=cvo.getAllRowsInRange();
    for (Row r:rArray){
    NameValuePairs nvp = new NameValuePairs();      
    nvp.setAttribute("Description",r.getAttribute("Description"));
    nvp.setAttribute("PlanNo",r.getAttribute("PlanNo"));
    nvp.setAttribute("MainAcc",r.getAttribute("MainAcc"));
    nvp.setAttribute("Plqty",r.getAttribute("Qty"));
    nvp.setAttribute("Cdkid",r.getAttribute("CdkId"));
    nvp.setAttribute("FabricCode",r.getAttribute("FabricCode"));
    nvp.setAttribute("DyeWash",r.getAttribute("DyeWash"));
    //  nvp.setAttribute("Description","test");
    Row drow = dvo.createAndInitRow(nvp);      
    dvo.insertRow(drow); 

  • ADF BC / parametrized where clause in view object

    Did something change is this area ?
    I testing using bind variables (as parameters) definition in my view object but i got this error during execution in the component browser
    (oracle.jbo.expr.JISyntaxError) Variable to_number not recognized
    Some of my variables are defined with default value as expression to_number( null ).

    The easiest way to set an entity attribute as the current date is to mark the attribute as a history attribute, and choose createdOn as the history type.
    If you want to use a groovy expression, you can use:
    DBTransaction.currentDbTime
    to reference the current database time.
    Or, the simplest way currently to reference the current JVM time in the correct format for an oracle.jbo.domain.Date to accept it as a default would be to create a class like:
    import java.sql.Timestamp;
    import oracle.jbo.domain.Date;
    public class ADF {
      public static Date getCurrentDate() {
        return new Date(Date.getCurrentDate());
      public static Date getCurrentDateWithTime() {
        return new Date(new Timestamp(System.currentTimeMillis()));   
    }and then use the groovy expression:
    ADF.currentDate
    or
    ADF.currentDateWithTime
    of course you can do the same thing "in-line" in the Groovy string, but it is less terse.
    We're considering adding some built-in methods to make some common operations like this easy from Groovy, but they are not in there currently.

  • How to edit the where clause of View object in search example dynamically

    Hi,
    I am new to OA Framework. Can anybody please tell me how can I assign the where clause dynamically. I want to search only those rows whose creation date is between a 'Date form' and 'Date to' inputs from the search page
    Thanks
    Anupam

    user567342 ,
    I will advice u again pls refer dev guide, there u can find code sample for ur requirement, which can be accomplished using stringbuffer.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • Bc4j: set where clause at runtime for view objcet ?

    how to set where clause for a view object that is not put in a subselect at runtime ?
    select a.para_id, b.para_para_id
    from table1 a, table2 b
    need to set at runtime either:
    where a.para_id = b.para_para_id
    or:
    where a.para_id = b.para_para_id(+)
    problem is that bc4j is useing it as followed:
    select * from (
    select a.para_id, b.para_para_id
    from table1 a, table2 b
    ) where (a.para_id = b.para_para_id(+))
    cant use outer join like this
    any suggestions

    If you do not want to issue the framework built query, you may want to set the query for a VO yourself instead of setting just the where clause by using setQuery() api. TO revert back to framework built query, call setQuery(null).
    This way, when you need the xtra where-clause and not the "innerSQL stuff", you can build a custom sql with whereclause etc, and call setQuery(), execute that SQL, perform your tricks with the VO and then when the VO is usage is done, reset the VO query to original by calling setQuery(null).

  • How to set query for child View Object?

    I have a hGrid in standard page. Two View Objects are present connected using view link. I need to set where clause in the child View Object. The changes are not getting reflected when i set the where clause. Also when i try to fetch rowCount it returns 0 for child View Object. But i am able to get the value for parent View Object. Any suggestions please.

    Hi,
    This solution worked for me last time, Please create One blank row and delete that row(For Child VO).
    Why we are doing this? : Because the child vo pointer might not init. See this is not our fault, this is because of OA Framework. But this works for me :)
    Thanks,
    Shrikant

  • Row Level Security using BO SDK - Dynamic Group and Criteria (where clauses)

    To the Universe Gurus out there:
    I have a rather daunting task of implementing a Row Level Security on a number of tables within our project using BO XI R2 SP2 with SQLServer 2005. Given the nature of the requirements around this (listed below), I am going to go with BO SDK to accomplish the creation of Restrictions. That said, I need some insight into some of the problem areas I have listed below. Any help is much appreciated.
    Background:
    We have 11 tables that are to be restricted.
    Each table is accessible to potentially 1..* group of users only.
    For eg SALES is accessible to ALL_SALES members only.
    Each row within each table is accessible to 1..* groups of users only. The restriction will occur on 2 columns Jurisdiction and LineID on SALES table.
    For eg
    1)Rows with NY Jurisdiction and LineID=123 are accessible to NY_SALES_ADMIN group only initially.
    2)NY_ADMIN will then approve that the above rows be open to NY_SALES_INTERNAL group only. This approval in turn will call upon the BO SDK to add a new restriction for the group with appropriate where clause.
    3)At a later point, the above rows will be opened to NY_SALES_EXTERNAL group also.
    This same concept holds good a number of jurisdiction (more or less static) and a dynamic number of LineIDs. So, if 10000 rows of data corresponding to new LineID 999 and Jurisdiction AK are in the table now, they are initially accessible only to AK_SALES_ADMIN group only. No one else should be able to access it.
    Results:
    1) With the way I laid out the business rules above, I am ending up with 528 groups.
    2) There is a restriction created for a unique combination of Jurisdiction and LineID for each table.
    Problems/Questions:
    How can I restrict access to the new rows to one group only. I know that I can let a certain group only look at certain data but how can I restrict that all others cannot look at the same.
    AK_SALES_ADMIN can look at LineID=999 and Jurisdiction='AK'.
    Do I use an Everyone group based restriction? If so, my Everyone group will end up with tons of restrictions. How will they be resolved in terms of priority.
    Am I even thinking of this the right way or is there a more noble way to do this?
    Regards

    the connectinit setting should look something like this:
    declare a date; begin vpd_setup('@VARIABLE('BOUSER')'); Commit; end;
    The vpd_setup procedure (in Oracle) should look like this:
    CREATE OR REPLACE procedure vpd_setup (p_user varchar)IS
    BEGIN
      DBMS_SESSION.set_vpd( 'SESSION_VALUES', 'USERID', p_user );
    END vpd_setup;
    Then you can retrieve the value of the context variable in your vpd functions
    and set the vpd.

  • Set Where Clause of VL Using Coding???

    How to Set Where Clause of VL(View Link) Using Coding???

    i think,if you can not change the VL def,change the SQL(like give a translate column)

  • Attribute set for Choice in view object xxPickSlipYesNoVO1 failed

    Hi all,
    I have a problem that i find pretty weird.
    The context is: I created a custom page that contains a table populated with some printer names. And the other field it contains is a messageChoice item. Both of these items are populated using custom VO that i also created and included in a custom AM. The VO that contains the printer names is used in a Query region with a table and it works perfectly. But the messageChoice is feeded by a VO that contains the following query :
    select 'No' choice from dual
    union
    select 'Yes' choice from dual
    I know this is very simple but i did not find any other way to populate the messageChoice than by using a view object. Where the problem comes is in the runtime behavior. When the custom page loads, "Yes" is automatically loaded in the dropdown. Then when i click the submit button it works perfectly but if i choose "No" i get the following message:
    Error
    Last Request Only - Attribute set for Choice in view object xxPickSlipYesNoVO1 failed
    Note: "Last Request Only" is the prompt of the messageChoice.
    And when this error is displayed the submit button does not want to work ....
    I dont know how to solve this i did some research but i did not find anyone with a similar issue!! yet! So i turned to you expertise to help me in solving this problem.
    Best Regards,
    Carl

    Carl,
    as u said u have removed the attribute sets created previously,. I would advice to delete myclassses folder , recompile and run. Also follow Sumit's suggetion for creating lookup, as that is the standard way of doing.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error: Attribute set for field_name in view object VO_instance failed

    While I try to add a new row in a table using a VO created on two EOs, it comes back with error message 'Attribute set for <field_name> in view object <VO_instance> failed' for each field I enter the data. Please suggest me if I am missing something while doing it.

    Are you sure you are specifying a value for the attribute of the VO and the value of correct data type.
    Also, please make sure that you have one row coming from each EO , so that the VO has one row, and a outer join is not happening.
    Thanks
    Tapash

  • Error:Attribute set for DetailHideShow in view object SalaryDetailsVO faild

    Hi
    We need to add one column in the self service Manager > My Employee Information > Salary history table
    - This column does not exist in the standard view Object
    oracle.apps.per.selfservice.mgrviews.server.SalaryDetailsVO
    - With Jdeveloper we have created a new view that extend the standard view :
    cggv.oracle.apps.per.selfservice.mgrviews.server.CGGVSalaryDetailsVO
    - We used the substitution tools to substitute the standard view by the new one
    with the following column :
    java oracle.jrad.tools.xml.importer.JPXImporter $CGG_MDS_TOP/cggv/per/12.0.0/java/ParodiExtendPJ.jpx -username apps -password
    apps -dbconnection "(description = (address_list = (address = (community =
    tcp.world)(proto = tcp)(host = doradb)(port =
    1581)))(connect_data = (sid=LDEV )))"
    - the new view contain exactly the same attribute than the standard one, we just add one new attribute at the end
    - We used Self-service perzonalisation functionality to add the new column in the table region.
    When we click on the Show buton the this error message appears :
    Error : Attribute set for DetailHideShow in view object SalaryDetailsVO failed
    It seems there is a probleme when extending ViewObject and adding column to table that contains a Show/Hide Detail column.
    Do we need extend also the controler ?
    Thank a lot for your help
    Julien Robinet

    Is the new column you have added part of the show/hide detail? If not, is the correct getting displayed?
    Is show/hide also handled through the attribute of substituted VO?
    --Shiv                                                                                                                                                                                                                                                                                                                                                                               

  • How to Set Distinct SQL Clause on View Object without using Expert Mode.

    Hi to all Actually i have a View Object usign 3 entities
    if i use expert mode in my VO, it generate
    QRSLT WHERE
    instruction and force to include all columns on my dynamic where clause on select statement i can't include columns because get me duplicate rows
    How i can include disctinct clause without usign expert mode or any other solution?
    Note that in normal mode without expert mode QRSLT WHERE is not generate and all work fine
    For example
    select * ( select id , name from table) QRSLT WHERE loc = ..
    if i use expert mode it generate QRSLT WHERE and if loc is not predicated colums get me and error :
    ( ORA-00904: invalid identifier )
    in simple mode of View Object all work fine..
    Any suggestion on It will be appreciate.....
    Tnx

    My problem is that when use expert mode
    it's change simple select statement for a select that use
    select * from (select column....)
    qrslt WHERE (column=somevalue)
    this kind of select force me to include all where conditions of qrslt on my select columns and this get duplicate rows
    thats beacuse i need include distinct without use expert mode
    Anny Help on this?

Maybe you are looking for

  • How do I set up using icloud on multiple pcs?

    I set up icloud on my home computer which was linked through Plaxo to my work PC so that everything I put into one would synce with the other. This weekend When i went to look, everything has been sucked out of outlook at home - which is fine, but wh

  • Ping Flash Media Server not working

    I just installed trial FMS on my XP Pc and I also installed IIS. I can login FMS control fine and see the applications ( this website sample code) that are inside applications folder. Unfortunately, the applications were not working, although the ser

  • Problem with conversion

    I am trying to convert from type p decimals 4 to character string value,it is giving error Value can't be interp. as floating-point number or longer than 22 charac. I am using following code. l_mean = w_mean_val-mean_val. l_mean TYPE qsollwertc, mean

  • Form.Location being ignored on second monitor

    Hi all! I have a form, and I'm trying to set the Location to a saved (previous) location. It seems to work fine for the primary monitor, but it is completely ignored for the secondary monitor, and the window is instead being places in the center of t

  • How do i return my mac to factory specs?

    I am giving my mac to my nephew and need to clean it out.  How do i do that without a disc.  I want to return it to the way i bought it.