View link accessor for master view object with bind variables

Is there a way to set bind variables for a view object to which a view link accessor is used to retrieve a view row from a detail view row in a master-detail relationship ?
I understand that RowSet (or Row) returned by a view link accessor originates from an "internally created" view object instance.
I am using 10.1.3.0.4 JDeveloper.

Thanks! that's right the bind variables when i use it on where clause must be required, so i change my sql to:
Select /*+ use_nl(p p2) */
'F' tipo_persona,
p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
From SINT_PERSONA p,
( Select /*+ index(a SINT_PERSONA_IX2) */
a.ID_PERSONA
From SINT_PERSONA_DOCUMENTO a
where ( NDOC = :p_cuit
and :p_cuit <> 0 )
) p2
Where p.id_persona = p2.id_persona
AND (deno = decode(:p_deno,'null',null,upper(:p_deno)) or
:p_deno = 'null')
AND (NDOC = decode(:p_ndoc,0,null,:p_ndoc) or
:p_ndoc = 0)
and grado_confiab > 0
and my bind variables:
p_ndoc required default value 0
p_cuit required default value 0
p_deno required default value null
and works ok!
thanks a lot !!!!

Similar Messages

  • View object with bind variables in subqueries

    Hi,
    i create view object with this query:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    My binding style is oracle named.
    Then I add the bind variables:
    p_cuit this is the only required
    p_ndoc
    p_deno
    but when i run the app module with p_cuit = 20123456780 i get this error:
    (oracle.jbo.SQLStmtException) JBO-27122: Error SQL durante la preparación de la sentencia. Sentencia: Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    ----- Nivel 1: Detalle 0 -----
    (java.sql.SQLException) Falta el parámetro IN o OUT en el índice:: 3
    How can i do this ?
    thanks.

    Thanks! that's right the bind variables when i use it on where clause must be required, so i change my sql to:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit <> 0 )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = decode(:p_deno,'null',null,upper(:p_deno)) or
    :p_deno = 'null')
    AND (NDOC = decode(:p_ndoc,0,null,:p_ndoc) or
    :p_ndoc = 0)
    and grado_confiab > 0
    and my bind variables:
    p_ndoc required default value 0
    p_cuit required default value 0
    p_deno required default value null
    and works ok!
    thanks a lot !!!!

  • Request for "WHERE  -   IN" Combination with Bind Variables.

    Hi,
    In ADF BC
    Im Creating the Bind Variables Searching methodolgy in ViewObject.
    SQL Editor:
    Query Like
    SELECT * FROM SEASON season WHERE season.MMYEAR IN (102007,112007) Here Done this query.
    In ViewObject Bind Variable Like B_MMYear .
    SQL Statement : SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season already is there in SQL Statement in ViewObject
    Just im adding this conditon "WHERE season.MMYEAR IN (:B_MMYear)"
    after
    Drag&drop the ExecutewithParams form
    and im giving the MMYear like *102007,112008* then push ExecutewithParams....no Rows to Display...
    when im giving the only one vlaue like 102007 (Or ) 112007 then displays the suitable Row.
    how i can give the query Like "WHERE - IN" Combination in Bind Variables.
    Thanks,
    Rama.
    Edited by: user634195 on Oct 17, 2008 6:37 AM

    Thanks for rply Mr Timo.
    my BindVariable is not Numeric Type...it as a String. ok
    i already checks the debugging
    but i didn't get Exact Query
    query seems without Values same As SQL Statement in ViewOBject.
    like this
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (:B_MMYear)
    you Know...India Season of the Culture....
    see.
    In India Colture have Two Seasions
    1.Rabi.
    2.Kharif.
    example:
    Present Year : 2008 ok
    Rabi Season Strats from Oct2008 to March2009.
    Kharif Season Starts from Apr2008 to Sep2008.
    ok
    In my JSP Page one DropDown is there that is Season ok.
    when i select the Rabi....Then Rabi Months comes to page in CoreTable.
    i already done in DB:
    For Rabi:
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (10,11,12,01,02,03) done.
    For Kharif:
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (04,05,06,07,08,09) also done.
    the realtion b/w Bind Variable and Value....i think is somethink diff.
    Edited by: user634195 on Oct 17, 2008 7:50 AM

  • View object with bind variables on jsf page

    I have jsf page with selectoncechoice field and the list is populated with view object query.
    I would like to change the page to include another text field before the selectonechoice and add where clasue to my view object to use this field value
    so i can limit the selectonechoice list and i want the list refreshed each time where clause field values changes on the page
    Thanks

    If you make the inputText field autoSubmit=true then your valueChangeListener for the field in the backing bean can invoke the "ExecuteWithParams" operation binding after finding it from the binding container.
    If you include my EL helper class from here:
    http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
    Then your backing bean can do:
      // Find the operation binding by name using EL
      OperationBinding b = (OperationBinding)EL.get("#{bindings.ExecuteWithParams}");
      // execute the operation binding
      b.execute();

  • ADF: use of view link Accessor in Entity Object = always null?

    Hi,
    JClient 9.0.5.2, adf model.
    I would like to use the view link accessor method in the master EO to retrieve detail EO values and the view link accessor method in the detail EO to retrieve master EO values.
    Detail Rule:
    In the detail EO an attribute is derived from an attribute of the master EO: detail attribute = master attribute.
    Master Rule:
    In the master EO an attribute is derived from the detail EO: master atribute set to 0 if detail EO exist else set to 0.
    Tables:
    Table Master => MasterEO => MasterVO
    - masterPK (not updateable)
    - masterField (not updateable)
    - hasDetailsFlag
    Table Detail => DetailEO => DetailVO
    - detailPK (not updateable)
    - masterPK => foreign key (not updateable)
    - masterField (query only)
    MasterDetailLink based on foreign key.
    In link wizard I asked for the generation of following accessors in the source & destination Entity Objects:
    In DetailEO accessor name: RetrieveFromMaster
    In MasterEO accessor name: RetrieveFromDetail
    In the DetailEO, I asked for the generation of the DetailEOImpl file, accessors and create method.
    As wriiten in the file, before the create method:
    ** Add attribute defaulting logic in this method. **
    I tought this is the place to retrieve the master attribute:
    The code:
    MasterVORowImpl masterVO = getRetrieveFromMaster();
    if (masterVO == null)
    System.out.println("MasterVORowImpl masterVO create NNNNNNNNNNNUUUUUUUULLLLLLLLLL");
    The masterVO is always null?
    I suppose I didn't understand something, my guest is that ViewObjects may not be used for default logic?
    I know how to implement those rules in the database with triggers.
    I think that the data I need for implementing those rules exist somewhere at the ADF level so retrieving the data from the db is not necessary?
    Could somebody give some clues?
    I didn't find a similar example in the Business Rules in BC4J document.
    Your help will be appreciated
    Frederic

    Hi,
    Detail Rule, copy attribute value form master.
    In DetailEOImpl:
    protected void create(AttributeList attributeList)
    setAttribute(MASTERFIELD,this.getMaster().getMasterField());
    super.create(attributeList);
    Master rule, set flag to 0 if no details else set to 1.
    In the MasterEOImpl added method to check if detail row exists based on Row Iterator => no db retrieval?
    This method also sets the flag accordingly:
    protected void checkHasOtherDetails()
    oracle.jbo.RowIterator ri = this.getRetrieveFromdetail();
    ri.last();
    // last() must be called else hasNext() returns true even on last delete ???
    Number hasDetails = Constants.NUMBER_NO; // = 1
    if (ri.hasNext() || ri.hasPrevious())
    hasDetails = Constants.NUMBER_YES; // = 0
    if (!getHasDetailsFlag().equals(hasDetails)) {
    this.setHasDetailsFlag(hasDetails);
    I call this method in the remove method of the detailEOImpl:
    public void remove()
    this.getRetrieeFromMaster().checkHasOtherDetails();
    super.remove();
    To set the flag I added follwoing code in the create method of the DetailEOImpl:
    protected void create(AttributeList attributeList)
    setAttribute(MASTERFIELD,this.getMaster().getMasterField());
    **** ADDED ***
    Number masterHasDetailsFlag = getRetrieveFromMaster().getHasDetailsFlag();
    if (!masterHasDetailsFlag.equals(Constants.NUMBER_YES)) {
    getRetrieveFromMaster().setHasDetailsFlag(Constants.NUMBER_YES));
    super.create(attributeList);
    One more question:
    Is there a danger of calling last() on row iterators in create/update/remove methods of *Impl files?
    => current row changed => any effect on display in JPanel
    Thanks
    Frederic
    PS All variable/method/class names have been manually renamed in this code so some small syntax problems may exist.

  • View link creation on two view objects, and both view objects are populated program(not from sql)

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

  • How to get the view link definition from the view link accessor

    Hi,
    I am using Jdev 10.1.3 and ADF BC. I am trying to do deep copy in a master/details view, after the new child record is created, I want to update the foreign key attribute. I know I can get the list of attribute definitions from the row in the view object, which include the view link accessors, I am wondering if I can get the view link definition from the view link accessors, so that I can get the source and destination attribute names.
    Thanks!

    Hi,
    you should get this through
    ViewObject vo = this.findViewObject("LocationsView1");
    int indx = vo.getAttributeIndexOf("DepartmentsView");
    ViewAttributeDefImpl vAttrDefImpl = (ViewAttributeDefImpl) vo.getAttributeDef(indx);
    ViewLinkDefImpl vdefImpl = (ViewLinkDefImpl) vAttrDefImpl.findViewLinkDefImpl();
    Note that this code starts from the ApplicationModuleImpl class, which is why I used this.findViewObject().
    Frank

  • View link accessor passes a ViewRowSetImpl

    9.0.5.1
    If I add a View link between a SQL only view object (A) and a View object (B) based on an entity object (cardinality 1 to 1) and request accessor methods are added to the view object (B) and the corresponding entity
    I get an accessor in view object (B)
    oracle.jbo.Row getXXXX - which seems okay
    I get in the entity object
    ViewRowImpl getXXXX - which also seems okay
    However when getXXXX is called in the entity object a ViewRowSetImpl object is being passed back and so the cast fails.
    I've checked the data and there is definitely only a one to one relationship between the data.
    Anyone have any ideas what could be wrong?

    I have the same problem with cardinality * to 0..1.
    The created view link accessor return a ViewRowImpl but at runtime it returns a ViewRowsetImpl and I get a ClassCastException
    I used following workaround:
    Define an association and read from the association accessor instead of the View Link accessor.
    ADF 10.1.2
    Thanks
    Frederic

  • View link between 2 public view object(PVO)

    Hi,
    Can we create a view link between 2 Public View Object(PVOs)? Is as same as creating view link b/w normal VOs.
    Regards,
    Suresh

    Hi,
    whats mean Public View Object? do you use BI?

  • How to bind the value of textbox with View object's bind variable?

    Hi all,
    In my use case I need to pass the value of textbox in the jsf page to the View Object's bind variable.
    I should not hard code this in my backing bean. I need to configure in the Jdeveloper itself.
    I am using Jdeveloper 11.1.1.4.0 version. Kindly come up with your help.
    Thanks,
    Phani.

    Hi,
    You have to use Named Bind Variables(ExecuteWithParams)
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/web_search_bc004.htm
    http://www.cloudsolid.com/2008/10/using-named-bind-variables.html

  • Iam getting Dump  Define Navigational Link FROMCORPACCOUNTSALESAREASEF for source view salesAreasEdit in component BP_SALES

    Iam getting Dumep  ,iam upgrading EHP4. Please team tell me any notes related to this-
    Define Navigational Link FROMCORPACCOUNTSALESAREASEF for source view salesAreasEdit in component BP_SALES.

    Hi Kalpana,
    Do we need to comment below highlighted code to resolve this issue?.
    because if i skip this code while debugging, i'm not getting dump.
    Please let me know.
    METHOD ip_fromcorpaccountsalesareasef.
       me->view_manager->navigate( source_rep_view = me->rep_view
                                 data_collection = iv_collection
                                 outbound_plug   = 'FROMCORPACCOUNTSALESAREASEF' ).
    ENDMETHOD.
    Regards,
    Nagaraju

  • View with Bind Variable and ADF table

    Hi all,
    Please note what i have noticed. I created a view with a bind parameter, overriden the prepareSession of my Application Module to set the bind parameter and execute the query. I then created a simple jsf page and included the view as an adf read-only table. When i run the page, the prepareSession is called, sets the bind parameter, however the selected record of the table is always the second record (Not the first record).
    This behaviour can be reproduced with the HR schema. Please follow the below instructions for reproducing the problem.
    1. Create a Fusion Web Application (ADF).
    2. Create business components from tables.
    3. Create a new connection with the HR schema.
    4. Import the Departments table as an entity and then click finish.
    5. Create a view based on the Departments entity.
    6. Modify the Query to include a where clause (where DDepartmentsEO.DEPARTMENT_NAME LIKE :BindParam)
    7. Provide an order by clause (DepartmentsEO.DEPARTMENT_ID DESC)
    8. Creata a bind variable named "BindParam" of type string.
    9. Create an Application Module and include the view object.
    10. Open the Application Module Class and override the prepareSession method
    11. include the following code after super.prepareSession(session):
    ViewObject myView = this.getDepartments1();
    myView.setNamedWhereClauseParam("BindParam", "%");
    myView.executeQuery();
    12. Create a jsf page
    13. Drag the view object on the page as an adf read-only table, selecting the Row Selection, Sorting and Filtering
    14. Run the page.
    You will see that instead of the first record being selected, the second record in the table is selected.
    Can anyone please help me?
    Thank you

    First of all i would like to thank you for replying to my thread.
    Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
    The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
    The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
    However, this is not how i want to implement this. This was working properly in 10g

  • Detail view with bind variable. TreeTable not showing all detail result.

    I’m having trouble with treeTable using detail view with bind variables and where clause defined in VO definition.
    Both, master and detail view objects, base on the same entity and have the same condition in where clause. The view objects also have bind variables, which are set in prepareRowSetForQuery() method.
    Again, these are two different views, that get different result, based on value of one of the bind variable.
    When I show results in two different tables on jsf page, where master table has "RowSelection" set on "single", all results are displayed in detail table.
    But when I use treeTable, only the first result of the detail is shown.

    I tested it in applicationModule and it works, but i think that's the same as two tables on a jsf page.
    This is the order in which overridden methods are called in ADF BC or two tables on jsf page
    when clicking on row in master table.
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;  -> print of the object2[] parameter in executeQueryForCollection
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035313 -> viewLink parameter value
    getEstimatedRowCount_Detail
    count: 2
    getEstimatedRowCount_Detail
    count: 2 And when i click on "expand node" in tree table:
    getEstimatedRowCount_Root
    count: 2
    PrepareRowSetForQuery_Detail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035321
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035313
    getEstimatedRowCount_Root
    count: 2
    getEstimatedRowCount_Root
    count: 2
    getEstimatedRowCount_Root
    count: 2
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035313
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035321
    getEstimatedRowCount_Root
    count: 2
    getEstimatedRowCount_Root
    count: 2Values of user parameters are OK. Is there another method that i should override?
    I also noticed, that if detail view doesn't have user bind variables, the tree works fine and is shown even in ADF BC (aplication module).
    I guess we loose a tree, when using bind variables in detail view object.
    Is there a way around it?

  • How to use ApplicationModuleImpl.createViewObject for VO with bind variable

    I need to implement a AM method to create VO instance from a generic VODef with bind variables.
    The createViewObject() will trigger the executeQuery of the VO before I can set up the bind variables for the query.
    What is the proper way to create view object instance with bind variables?

    I am using JDeveloper 11.1.1.2.
    I have a ViewObjectA declared with some bind variables which determine what business data to be retrieved at runtime via a service method of the ApplicationModule.
    As the ViewObjectA is only referenced internally within ApplicationModule and I need more than one instance of the ViewObjectA for different conditions at runtime,
    I use ApplicationModuleImpl.createViewObject() to create an instance of ViewObjectA instead of adding ViewObjectA to the data model of the ApplicationModule.
    Currently, when the ViewObjectA is instantiated, it also trigger an executeQuery() which will not retrieve correct data until I set up the bind variables.
    However, the createViewObject() method doesn't let me pass in the values of the binding variables.
    Currenlty, I just call the createViewObject() and then set the binding variables values and call executeQuery() again.
    Just checking if there is a better way to do so...

  • Report Performance with Bind Variable

    Getting some very odd behaviour with a report in APEX v 3.2.1.00.10
    I have a complex query that takes 5 seconds to return via TOAD, but takes from 5 to 10 minutes in an APEX report.
    I've narrowed it down to one particular bind. If I hard code the date in it returns in 6 seconds, but if I let the date be passed in from a parameter it takes 5+ minutes again.
    Relevant part of the query (an inline view) is:
    ,(select rglr_lect lect
    ,sum(tpm) mtr_tpm
    ,sum(enrols) mtr_enrols
    from ops_dash_meetings_report
    where meet_ev_date between to_date(:P35_END_DATE,'DD/MM/YYYY') - 363 and to_date(:P35_END_DATE,'DD/MM/YYYY')
    group by rglr_lect) RPV
    I've tried replacing the "to_date(:P35_END_DATE,'DD/MM/YYYY') - 363" with another item which is populated with the date required (and verified by checking session state). If I replace the :P35_END_DATE with an actual date the performance is fine again.
    The weird thing is that a trace file shows me exactly the same Explain Plan as the TOAD Explain where it runs in 5 seconds.
    Another odd thing is that another page in my application has the same inline view and doesn't hit the performance problem.
    The trace file did show some control characters (circumflex M) after each line of this report's query where these weren't anywhere else on the trace queries. I wondered if there was some sort of corruption in the source?
    No problems due to pagination as the result set is only 31 records and all being displayed.
    Really stumped here. Any advice or pointers would be most welcome.
    Jon.

    Don't worry about the Time column, the cost and cardinality are more important to see whther the CBO is making different decisions for whatever reason.
    Remember that the explain plan shows the expected execution plan and a trace shows the actual execution plan. So what you want to do is compare the query with bind variables from an APEX page trace to a trace from TOAD (or sqlplus or whatever). You can do this outside APEX like this...
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 1';Enter and run your SQL statement...;
    ALTER SESSION SET sql_trace=FALSE;This will create a a trace file in the directory returned by...
    SELECT value FROM v$parameter WHERE name = 'user_dump_dest' Which you can use tkprof to format.
    I am assuming that your not going over DB links or anything else slightly unusual?
    Cheers
    Ben

Maybe you are looking for

  • Music App no longer showing Artist view iOS6

    In the Music app on iOS 6 I have accidentally changed the Artist column under More -> Edit to only include albums by Linkin Park. I am not sure how to revert to showing all Artists. Is there any way to reset the views? For some additional information

  • Remittence fror TDS (OT) type

    Dear All, Thanks to all of you for the support. I have made an Invoice wherein I have deducted TDS from the vendor as per the norm. The TDS has got successfully got deducted and the TDS ledger has got updated. ITS fine. Now the problem is that for th

  • Error ORABPEL-10903

    Hi, I am using eclipse version 0.9.13 and working through the creditflow example. I am getting the following error message on Windows 2000 using java 1.4 Buildfile: C:\Documents and Settings\dkunzman\workspace\CreditFlow\build.xml main: [bpelc] BPEL

  • ASP files not showing in Firefox

    I made a template with a spry menu bar. When I create new webpages based on the template, the new files are automatically saved as .asp files. The site works great in IE. But in Firefox, the page refuses to render at all. All I get is the pages HTML/

  • How can i view videos (other then youtube) through safari?

    if i wanted to watch a video on metacafe.com or news.com etc, how can i view them on my Ipod Touch, it seems the only online content is on the YouTube App.