Where clause in Master-Detial (BC4J+uiXML)

Hi All,
I have used uiXML + BC4J. I have problems again.
I create two ViewObjects PlannerVO and ObjectiveVO,its have ViewLink Planner-0..1 to Objective - * ,which like master-detial pattern ,and join by EN Attribute (its have common fileds both).
I create uiXML for BC4J by wizard. First i can render it and can click next or browse. Now I would like to pass parameter for filter it by where clause on master (PlannerVO). like this
http://10.50.0.152:8988/Workspace4-TestBG-context-root/Planner2Objtive_View.uix?en=002182
in Planner2Objtive.uix on the last line code I write more my tag , this is
     <event name="*">
          <bc4j:findRootAppModule name="Planner2ObjtiveAppModule">
               <bc4j:findViewObject name="PlannerVO">
                    <method class="mypackage.ViewFilter" method="filterByEn"/>
               </bc4j:findViewObject>
          </bc4j:findRootAppModule>
     </event>and in ViewFilter.java
public class ViewFilter  {
  static public EventResult filterByEn(
    BajaContext   context,
    Page          page,
    PageEvent     event) throws Throwable
    EventResult result = new EventResult(page);
    // Check for event parameters that we care about
    if (event != null)
     String en = event.getParameter("en");
     ViewObject view = ServletBindingUtils.getViewObject(context);
     view.setWhereClause("Planner.EN = "+en);
     view.executeQuery();
      // Shove the value on the EventResult so we
      // can reference it from our UIX page
      result.setProperty("en", en);
    return result;
}I get EN from URL and then pass it to uiXML and to Java for query BC4j Object,it not return any thing. In debug windows ,its have to query first for PlannerVO and second for ObjectiveVO ,on second query ObjectiveVO I see it pass null to second query (becuase of its must pass EN attribute from master PlannerVO to join it). What this its mean, first query has not success? or in this method can not filter by where clause.

I am not sure I understand your problem.
What I do see is that there is no event on your url:
Planner2Objtive_View.uix?en=002182
so your check:
if (event != null)
will always be false.
If you port the uiXML fragment that you use to create the url, I can tell you how to set an event on it.

Similar Messages

  • JSP, Data Web Bean, BC4J: Setting the where clause of a View Object at run time

    Hi,
    I am trying to develop a data web bean in which the where clause of a View Object will be set at run time and the results of the query then displayed.
    My BC4J components are located in one project while the coding for the data web bean is in another project. I used the following code bu t it does not work. Could you please let me know what I am doing wrong?
    public void populateOSTable(int P_EmpId)
    String m_whereString = "EmpView.EMP_ID = " + P_EmpId;
    String m_OrderBy = "EmpView.EMP_NAME";
    oracle.jbo.ApplicationModule appModule = null;
    ViewObject vo = appModule.findApplicationModule("EMPBC.EMPAppModule").findViewObject("EMPBC.EMPView");
    vo.setWhereClause(m_whereString);
    vo.setOrderByClause(m_OrderBy);
    vo.executeQuery();
    vo.next();
    String empName numAttrs = vo.getAttribute(EmpName);
    System.out.println(empName);
    Thanks.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDev Team (Laura):
    Here is how I have usually done mine:
    1. In the JSP, use a RowsetNavigator bean to set the where clause and execute the query.
    2. Use a custom web bean to process the results of the query (print to HTML).
    for example:
    <jsp:useBean class="oracle.jbo.html.databeans.RowsetNavigator" id="rsn" scope="request" >
    <%
    // get the parameter from the find form
    String p = request.getParameter("p");
    String s = request.getParameter("s");
    // store the information for reference later
    session.putValue("p", p);
    session.putValue("s", s);
    // initialize the app module and view object
    rsn.initialize(application,session, request,response,out,"wt_bc_WT_bcModule.wtjoinView");
    // set the where clause string
    String theclause = "presname = '" + p + "' AND slideno=" + s;
    // set the where clause for the VO
    rsn.getRowSet().getViewObject().setWhereClause(theclause);
    rsn.getRowSet().getViewObject().executeQuery();
    rsn.getRowSet().first();
    %>
    </jsp:useBean>
    <jsp:useBean class="wt_bc.walkthruBean" id="wtb" scope="request" >
    <%
    // initialize the app module and VO
    wtb.initialize(application,session, request,response,out,"wt_bc_WT_bcModule.wtjoinView");
    wtb.render();
    %>
    In this case, the render method of my custom web bean mostly gets some session variables, and prints various content depending on the session variable values.
    Hope this helps.
    </jsp:useBean><HR></BLOCKQUOTE>
    Laura can you give the code of your walkthru bean? i wna't to initialize a viewobject, set the where clause and give that viewobject back to initialize my navigatorbar.
    Nathalie
    null

  • Dynamically changing the WHERE clause in detail VO in Master Detail

    Hi, I want to develop a search functionality, results will be in a table, which will have an inline table displaying the details per row found.
    I have a MD defined trough viewlink. I do change the master VO at runtime (set the entire SQL), based on the criteria entered by the user.
    Is there a way to change the VO at the detail end of the link at runtime - that is what I haven't been able to do.
    I have read that the ADF framework creates internal VO for each master row, whenever accessed trough accessor (which is not I am trying to do). I haven't been able to find a way to get a hold of the REAL VO at the detail end and have its WHERE clause changed.
    Changes to the "VO instance in AM" (same one used as a definition in the detail end in the ViewLink def) does not seem to reflect the detail VO.
    I have a MasterView, DetailView, MasterDetailLink (MasterView->DetailView).
    MasterDetailLink is used to create a table with inline detail table. At runtime:
    1.get MasterView (from AM), change query trough setQuesry() - works.
    2.get DetailView (from AM), change query trough addWhereClause() - does not work (no exceptions) - the results I am getting DO NOT reflect the conditions of the where clause, I mean the clause have not been addedd.
    I 've looked at the logs (debug enabled) and it seems to me that there no "activities" related to the detail VO, even after the where clause of the VO from step 2 is changed.
    Looks like there is a separate VO which I would like to get a hold of :)
    Thanks, and sorry for the long explanation

    After you have added a new where clause on the detail VO, try re-executing VO's query by DetailVO.executeQuery()
    If it doesn't work try re-executing the MasterVO's query after you have added the where clause on the detail

  • Incorrect Where Clause being set in Master Block

    I got a strange error the other day. I have 2 database blocks in a form and the blocks are based on views. So, lets say Block1 is based on View1 and Block2 is based on View2. Block1 and Block2 are also in a Master Detail relationship. So, Block B1 is the Master and Block B2 is the Child.
    So, our error routine captures the last query that was run by doing a :SYSTEM.LAST_QUERY. What was interesting was that a user got Error FRM-40505 which basically means "ORACLE error: unable to perform query".
    Looking at the Last Query, it basically tried to get the WHERE Clause from the View2 instead of the View1 in which case there was a problem Querying that block and thus getting Error 40505.
    The where clause that is being created is actually coming from the where clause of View2 which has been set up in the Property Sheet value.
    Am not putting any code here for now but if that helps, I can put some code in there.
    Any help is appreciated.

    If you are executing a query from one of your own buttons or some other programmatic manner be sure focus is in the master block. Remember that if you are clicking on a button, focus is moved to the button. In this case, your first line of code in the button should be something like GO_BLOCK('MY_MASTER_BLOCK')
    If that doesn't help, I would recommend creating a new form. Use the Data-block and Layout Wizards to create the master block then the detail block. Allow the Wizard to create all the code needed for the relationship. Once this relationship has been created, manually create a new block. Be sure that the new block is positioned below your first two blocks. In other words:
    + Data Blocks
    ...+ master_block
    ...+ detail_block
    ...+ my_block
    Add one text item to this new block. Set the max number of characters to 32767 and set Multiline to YES. Now create a form level, POST-QUERY trigger doing something similar to what you mentioned already doing:
    :text_item1 := :system.last_query

  • A bug? BC4J ViewObject where clause change doesn't affect view contents

    Hi!
    I've found the following interesting behaviour (maybe a bug?) of BC4J ViewObject caching:
    1) make a viewobject with where clause and 1 parameter in it.
    2) set parameter binding to some value
    3) execute query
    4) then change viewobject's where clause, but leave parameter binding intact
    5) execute query again
    6) view object contents haven't changed!
    actually, changing where clause text should make view object requery data from the database instead of using cached rows...
    If to add a call to viewobject.clearCache() before second viewobject.executeQuery(), then everything works fine and view object's contents are changed.
    Does anybody have any ideas about this? Or is this a some kind of a feature, or it is already fixed in a newer version of JDev?
    Thnx!
    PS. JDeveloper version 9.0.3.4 (build 1247).

    delete message

  • Where Clause messing up results of Query using BC4J

    Hello all.
    I am developing a hand-coded JSP application that uses BC4Js and is deployed to a 9iAS on a SPARC box.
    I'm not sure what has been happening, but the results that are printed out to the screen are vastly different from the SQL results. I've gone as far as printing the Query that is executed onto the results page and have run it on SQL*Plus -- the query works on Plus, but displays no rows on the screen.
    I have a pretty complex where clause, I compare around four columns, and while developing I noticed that the sequencing of the columns greatly affected the output.
    Is this the same case?
    Thanks for the help!

    Additional Information:
    One of the Where parameters is a date range, when I made the range narrow I was able to get the right number of rows for the result set (34 in all). But when I widened it to the day right after that, I got no results.
    I'm stumped.

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

  • ViewObject with Where clause

    I am using JDev 9.03.
    I created a VO and in expert mode I added a where clause that accepts 1 parameter. I have a uiXML page that needs to pass a parameter to a second page and use that parameter in the VO where clause. I need to have the parameter set in the where clause before the page can be rendered. How do I do this?

    I have been watching another thread and received an answer as to how to do this within a servlet.
    Viktor wrote:
    You must get exactly the same object that bc4j has created.
    From bajacontext you can reach everything...
    like appmodule.. and even ViewObject..
    Add a null event, which runs before your page is rendered...
    <event name="null">  
    <bc4j:findRootAppModule name="PenCmpAppModule">
    <bc4j:findViewObject name="RdmsViewUsage">           
    <method class="FrmFilters" method="handleRdms"/>   
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>and create an event handler...
    public static EventResult handleRdos(BajaContext context, Page page, PageEvent event)  
    {    ViewObject vobj= ServletBindingUtils.getViewObject(context);    
    HttpSession session = context.getServletRequest().getSession(false);    
    String OrgId=(String)session.getAttribute("S_ORGID");    
    vobj.setWhereClause("ORG_ID='"+OrgId+"'");    
    vobj.executeQuery();    
    return null;   }

  • JSP, DataWebBean: How to dynamically set the where clause of query and display record

    Hi,
    I am reposting this question as per suggestions made by Mr. Dwight.
    I have used ViewCurrentRecord web bean to display records from EMP table. I have to use the Dept_Id_FK from the current
    record of the EMP table to display corresponding records of Dept table. I have a view object called DeptView in my Business
    Components which selects all the records from the Dept table.
    How do I get the value of Dept_Id_FK and use it to display the required records of the Dept table?
    I tried to declare a variable and get the value of Dept_Id_FK but it did not work. My code is as follows:
    <%! String m_DeptId = null; %>
    <jsp:useBean id="RowViewer" class="oracle.jbo.html.databeans.ViewCurrentRecord" scope="request">
    <%
    RowViewer.initialize(pageContext, "EMPApp_EMP_EMPAppModule.EMPView1");
    RowViewer.setReleaseApplicationResources(false);
    RowViewer.getRowSet().next();
    m_DeptId = (String)RowViewer.getRowSet().getCurrentRow().getAttribute("DeptIdFk");
    %>
    </jsp:useBean>
    Thanks.
    null

    First of all, Thank you very much for making use of the new topic format. It is very much appreciated.
    As for your question, I think there are several different ways to accomplish what I think you want to do.
    1. Create a view object that includes both Emp and Dept entities and join them there. In this case, your query would look something like this:
    Select e.empno,e.name,...,d.dname,d.loc from emp e, dept d
    where e.deptno = d.deptno
    You should be able to create a JSP off of this view object that contains both the employee and department information. In this case, BC4J takes care of the foreign key to primary key coordination.
    2. In order to set a dynamic where clause for a view, you need to do the following in your usebean tag:
    rsn.initialize(application,session, request,response,out,"DeptView");
    rsn.getRowSet().getViewObject().setWhereClause("deptno=" &#0124; &#0124; m_DeptId);
    rsn.getRowSet().getViewObject().executeQuery();
    rsn.getRowSet().first();
    You will need to do this in a separate usebean tag from the EmpView, since the usebean can only initialize one view object.
    In other words, you would have your ViewCurrentRecord bean tag for the EmpView, then a separate one for the DeptView where you use the above code to set the where clause to display just the information for the department you want.
    Another option, but one I'm not sure would work as well, is to create a master-detail JSP to do this for you. Usually a master-detail is a one-to-many (one department to many employees). Your request appears to be the reverse, but might still be doable using the same mechanism.
    You set up relationships between views in your BC4J project using View Links. If you used the BC4J project wizard and created default views, some of these links may have been created for you. They are created when BC4J detects a foreign key to primary key relationship in the database.
    You can create your own View Links using the View Link wizard. Select your BC4J project node and choose Create View Link... from the context menu. You will be asked to select a source view (Emp), and a target view (Dept), then select the attribute in each view that related the two of them (deptno).
    Next, you need to reflect this new relationship setting in your application module. Select your app module and choose Edit from the context menu. On the data model page, select the EmpView node in the Selected list. Now select the DeptView node in the available list and shuttle it over. You should see DeptView1 via yourlink appear indented under the EmpView node. Save and rebuild your BC4J project to reflect the changes.
    In your JSP project, you can now have the wizard create a master-detail form for you based on DeptView1.
    Let me know if the above answers your question, or if I have misunderstood what it is you wanted to do.
    null

  • Index usage in depending on where clause changes.

    Hello Friends,
    I need your help for one issue.
    I have one query , which is using two table Say T1 and T2, where C1 is common column using which both are joined.
    C1 is primary key in T1, but no index available in T2 for C1. T1C2 is the column which we want to select.
    (Note that Either of table can be a Master table)
    Now see the query:
    Select T1C2
    From T1, T2
    where T2.C1 = T1.C1
    Here where clause may have other conditions and From clause may have others tables as per requirements.
    I want to know that, if, I change the query like following to let my query use the available index of T1.C1.
    Select T1C2
    from T1, T2
    where T1.C1 = T2.C1
    Then, Will the query use the available index of T1. and Will i get better performance. Even a little improvement in performance may help me a lot as this kind of query is being used within a where loop (so it is going to be executed multiple times).
    Please advise on this..
    Regards,
    Dipali..

    Hi,
    18:43:17 rel15_real_p>create table t1(c1 number primary key, c2 number);
    Table created.
    18:43:26 rel15_real_p>create table t2(c1 number, c2 number);
    18:45:08 rel15_real_p>
    18:45:09 rel15_real_p>begin
    18:45:09   2  for i in 1..100
    18:45:09   3  loop
    18:45:09   4        insert into t1(c1,c2) values (i,i+100);
    18:45:09   5  end loop;
    18:45:09   6  commit;
    18:45:09   7  end;
    18:45:09   8  /
    PL/SQL procedure successfully completed.
    18:45:09 rel15_real_p>
    18:45:09 rel15_real_p>
    18:45:09 rel15_real_p>begin
    18:45:09   2  for i in 1..100
    18:45:09   3  loop
    18:45:09   4        insert into t2(c1,c2) values (i,i+200);
    18:45:09   5  end loop;
    18:45:09   6  commit;
    18:45:09   7  end;
    18:45:09   8  /
    18:45:23 rel15_real_p>select count(*) from t1;
      COUNT(*)
           100
    18:45:30 rel15_real_p>select count(*) from t2;
      COUNT(*)
           100
    18:45:49 rel15_real_p>select index_name,index_type from user_indexes where table
    _name='T1';
    INDEX_NAME                     INDEX_TYPE
    SYS_C0013059                   NORMAL
    18:48:21 rel15_real_p>set autotrace on
    18:52:25 rel15_real_p>Select T1.C2
    18:52:29   2  From T1, T2
    18:52:29   3  where T2.C1 = T1.C1
    18:52:29   4  /
            C2
           101
           102
           103
           104
           105
            C2
           200
    100 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=7 Card=100 Bytes=
              900)
       1    0   HASH JOIN (Cost=7 Card=100 Bytes=3900)
       2    1     TABLE ACCESS (FULL) OF 'T1' (TABLE) (Cost=3 Card=100 By
              es=2600)
       3    1     TABLE ACCESS (FULL) OF 'T2' (TABLE) (Cost=3 Card=100 By
              es=1300)
    Statistics
              0  recursive calls
              0  db block gets
             21  consistent gets
              0  physical reads
              0  redo size
           1393  bytes sent via SQL*Net to client
            562  bytes received via SQL*Net from client
              8  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
            100  rows processed
    18:52:31 rel15_real_p>analyze table t1 compute statistics;
    Table analyzed.
    18:55:35 rel15_real_p>analyze table t2 compute statistics;
    18:55:38 rel15_real_p>set autotrace on
    18:55:42 rel15_real_p>Select T1.C2
    18:55:43   2  From T1, T2
    18:55:45   3  where T2.C1 = T1.C1
    18:55:46   4  /
            C2
           101
           102
           103
           104
           105
            C2
           200
    100 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=6 Card=100 Bytes=7
              00)
       1    0   MERGE JOIN (Cost=6 Card=100 Bytes=700)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'T1' (TABLE) (Cost=2 Ca
              rd=100 Bytes=500)
       3    2       INDEX (FULL SCAN) OF 'SYS_C0013059' (INDEX (UNIQUE)) (
              Cost=1 Card=100)
       4    1     SORT (JOIN) (Cost=4 Card=100 Bytes=200)
       5    4       TABLE ACCESS (FULL) OF 'T2' (TABLE) (Cost=3 Card=100 B
              ytes=200)
    Statistics
              1  recursive calls
              0  db block gets
             23  consistent gets
              0  physical reads
              0  redo size
           1393  bytes sent via SQL*Net to client
            562  bytes received via SQL*Net from client
              8  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
            100  rows processed
    18:56:56 rel15_real_p>Select T1.C2
    18:56:56   2  From T1, T2
    18:56:56   3  where T1.C1 = T2.C1
    18:56:58   4  /
            C2
           101
           102
           103
           104
           105
            C2
           200
    100 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=6 Card=100 Bytes=7
              00)
       1    0   MERGE JOIN (Cost=6 Card=100 Bytes=700)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'T1' (TABLE) (Cost=2 Ca
              rd=100 Bytes=500)
       3    2       INDEX (FULL SCAN) OF 'SYS_C0013059' (INDEX (UNIQUE)) (
              Cost=1 Card=100)
       4    1     SORT (JOIN) (Cost=4 Card=100 Bytes=200)
       5    4       TABLE ACCESS (FULL) OF 'T2' (TABLE) (Cost=3 Card=100 B
              ytes=200)
    Statistics
              1  recursive calls
              0  db block gets
             23  consistent gets
              0  physical reads
              0  redo size
           1393  bytes sent via SQL*Net to client
            562  bytes received via SQL*Net from client
              8  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
            100  rows processed- Pavan Kumar N

  • Where clause with Bind Variable in ViewObject

    As per recomendations from Jdev team they say that using Bind varialbles in where clause will improve the performance (Option 1) But it is causing us to create more view objects.
    Example : Lets say we have a View Object EmpVO
    Option 1:
    ViewObject vo=context.getViewObject("EmpVO");
    vo.setWhereClause("EMPNO=?");
    vo.setWhereClauseParam(0,st);
    (or)
    Option 2:
    vo.setWhereClause("EMPNO="+st);
    If we want to use same View Object "EmpVO" in another Action Class
    ViewObject vo1=context.getViewObject("EmpVO");
    vo1.setWhereClause("DEPTNO=?");
    vo1.setWhereClauseParam(0,str);
    It this case it throws an error saying BIND VARIABLE already exits. So we have to make another View Object.
    Where as if we did not use bind variable but used Option 2 approach the same view object can be used in multiple pages.(at the expense of performance as per Jdev team)
    Are we doing something wrong here or are there other ways to use the same view object when using bind variable in where clause.
    Thanks

    I haven't been using BC4J for a while, but I seem to recall that the recommendations are that you don't set the where clause at runtime: You're supposed to define your view with the bind parameter already in it.
    So you'd probably define an EmpsForEmpNoVO and type "EMPNO = ?" in the where box. (There are other ways of finding a single row/entity and one of those may well be more efficient. Perhaps a better example of where you might want a view of employees is WHERE DEPTNO = ?.)
    IIRC, all instances of a particular type of view share the same definition, so you have to be careful if you alter that at runtime. However, I think everything's set up so that you can have many different (and separate) resultsets for a single view (instance) - meaning that it's possible to "run" a view for (e.g.) two different ids. (It's definitely possible to create two different instances of a view from its definition - and the resultsets will definitely be separate then. I think there's a "create" method on the application module; I remember that "find..." always returns the same instance of the view.)
    Hope that's a push in the right direction (since no-one else had replied - and I hope not too much has changed since 9.0.3)....
    Mike.

  • ADF BC View Objects: Disappearing where clauses

    Playing around with the 11g Technical Preview I find out that sometimes the where clauses - added to View Objects by means of the new "Join Type" field in the VO-editor UI - disappear.
    I'm not able to reproduce exactly and "on demand", but it seems to happen when the sources of more than one View Object are open simultaneously and/or the XML definition of a View Object is edited directly on the Source-tab.

    Today I succeeded in reproducing:
    Two tables:
    TAB_MASTER:
    ID NUMBER NOT NULL
    DESCRIPTION VARCHAR2 NOT NULL
    TAB_DETAIL:
    ID NUMBER NOT NULL
    MASTER_ID NUMBER NOT NULL
    DESCRIPTION VARCHAR2 NOT NULL
    TAB_DETAIL.MASTER_ID is a foreign key referencing TAB_MASTER.ID.
    Steps to reproduce:
    1. Generate default ADF BC objects from database tables.
    2. Open definition of TAB_DETAIL View Object.
    3. Go to the Entity Objects tab
    4. Add TAB_MASTER Entity Object to the Selected Entities Objects. Association and Join Type are filled in automatically.
    5. Go to the Query tab and go to SQL tab in de Property Inspector. Where clause is filled.
    6. Go to the Attributes tab and click Add from Entity...
    7. Add TAB_MASTER.DESCRIPTION attribute.
    8. Again, go to the Query tab and go to SQL tab in de Property Inspector. Where clause is still filled.
    9. Go to the Attributes tab and select MASTER_ID attribute.
    10. Click icon to add List Of Values
    11. In List Of Values dialog add View Object TAB_MASTER and add the correct pairs of List Return Values for the ID and (MASTER) DESCRIPTION attributes.
    12. After completing the List Of Values dialog go to the Query tab -> SQL tab again. The where clause added to join the Entity Objects (see step 5.) is cleared, resulting in a wrong SQL statement for the View Object.

  • Passing a value to Inline View  WHERE clause through JDev...

    Hi ,
    I need to pass a value to inline view which is mentioned in below VIEW query.
    That view is created inside a view using jDev. Note that there are two WHERE clauses one in the Main query and the other in the Inline view.
    How to set the value for the innerView.
    //copied the code from Java
    view.volAlertsHistroyView.setWhereClauseParam(1, new Integer(clientId));
    Gives an error Missing IN or OUT parameter at index:: 1
    SELECT Alerts.SEND_TIME,
         Alerts.STATUS,
         Alerts.TEXT ,
         Groups.NAME,
              VolRoles.ROLE_NAME,
                   VolRoles.ID as vid,
                   Groups.ID as gid
         FROM ALERTS Alerts, ALERTS_GROUPS AlertsGroups, GROUPS Groups, VOL_ROLES VolRoles,
    --Inline view starts
    (SELECT GRP_ID, VRL_ID FROM vol_groups WHERE cli_id = :1) user_group_role
    --Inline view ends
    --Actual WHERE clause starts
         WHERE ((Alerts.ID = AlertsGroups.ALT_ID)AND (AlertsGroups.GRP_ID = Groups.ID))AND (AlertsGroups.VRL_ID = VolRoles.ID)
         AND AlertsGroups.VRL_ID = user_group_role.VRL_ID AND AlertsGroups.GRP_ID = user_group_role.GRP_ID
    Please get back to me .
    Regards
    Mohan
    [email protected]

    What happens when you change your Java code to:
    view.volAlertsHistroyView.setWhereClauseParam(0, new Integer(clientId));
    The ":1" does not directly relate to the where clause param index you use in Java. In your query you could also use a ":2" for example. In BC4J you still use "0" for the first param.
    Sascha

  • Error while using REMAP_TABLE and WHERE clause  together in IMPDP

    I am trying to move some records from a very large table to another small table.
    I am facing trouble while using REMAP_TABLE and WHERE clause together in IMPDP.
    Problem is data filter is not getting applied and all records are getting imported.
    here is how I have simulated this. please advice.
    CREATE TABLE TSHARRHB.TMP1
      A  NUMBER,
      B  NUMBER
    begin
    Insert into TSHARRHB.TMP1
       (A, B)
    Values
       (1, 1);
    Insert into TSHARRHB.TMP1
       (A, B)
    Values
       (2, 2);
    COMMIT;
    end;
    expdp system/password TABLES=tsharrhb.TMP1 DIRECTORY=GRDP_EXP_DIR DUMPFILE=TMP1.dmp REUSE_DUMPFILES=YES LOGFILE=EXP.log PARALLEL=8
    impdp system/password DIRECTORY=GRDP_EXP_DIR DUMPFILE=TMP1.dmp LOGFILE=imp.log PARALLEL=8 QUERY='TSHARRHB.TMP1:"WHERE TMP1.A = 2"'  REMAP_TABLE=TSHARRHB.TMP1:TMP3 CONTENT=DATA_ONLY
    Import: Release 11.2.0.1.0 - Production on Fri Dec 13 05:13:30 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/********@GRD6.RBSG DIRECTORY=GRDP_EXP_DIR DUMPFILE=TMP1.dmp LOGFILE=SSD_93_TABLES_FULL_EXP.log PARALLEL=8 QUERY=TSHARRHB.TMP1:"WHERE TMP1.A = 2" REMAP_TABLE=TSHARRHB.TMP1:TMP3 CONTENT=DATA_ONLY
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    . . imported "TSHARRHB"."TMP3"                           5.421 KB       2 rows
    Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 05:13:33
    here I am expecting only 1 record to get imported but both the records are getting imported. please advice.

    The strange thing compared to your output is that I get an error when I have table prefix in the query block:
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** DUMPFILE=TMP1.dmp LOGFILE=imp.log PARALLEL=8 QUERY=SYSADM.TMP1:"WHERE TMP1.A = 2" REMAP_TABLE=SYSADM.TMP1:TMP3 CONTENT=DATA_ONLY
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    ORA-31693: Table data object "SYSADM"."TMP3" failed to load/unload and is being skipped due to error:
    ORA-38500: Unsupported operation: Oracle XML DB not present
    Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 1 error(s) at Fri Dec 13 10:39:11 2013 elapsed 0 00:00:03
    And if I remove it, it works:
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** DUMPFILE=TMP1.dmp LOGFILE=imp.log PARALLEL=8 QUERY=SYSADM.TMP1:"WHERE A = 2" REMAP_TABLE=SYSADM.TMP1:TMP3 CONTENT=DATA_ONLY
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    . . imported "SYSADM"."TMP3"                             5.406 KB       1 out of 2 rows
    Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at Fri Dec 13 10:36:50 2013 elapsed 0 00:00:01
    Nicolas.
    PS: as you can see, I'm on 11.2.0.4, I do not have 11.2.0.1 that you seem to use.

  • Export (expdp) with where clause

    Hello Gurus,
    I am trying to export with where clause. I am getting below error.
    Here is my export command.
    expdp "'/ as sysdba'" tables = USER1.TABLE1 directory=DATA_PUMP dumpfile=TABLE1.dmp logfile=TABLE1.log query= “USER1.TABLE1:where auditdate>'01-JAN-10'” Here is error
    [keeth]DB1 /oracle/data_15/db1> DATA_PUMP dumpfile=TABLE1.dmp logfile=TABLE1.log query= USER1.TABLE1:where auditdate>'01-JAN-10'                    <
    Export: Release 11.2.0.3.0 - Production on Tue Mar 26 03:03:26 2013
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYS"."SYS_EXPORT_TABLE_03":  "/******** AS SYSDBA" tables=USER1.TABLE1 directory=DATA_PUMP dumpfile=TABLE1.dmp logfile=TABLE1.log query= USER1.TABLE1:where auditdate
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 386 MB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
    Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type TABLE_EXPORT/TABLE/TRIGGER
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    ORA-31693: Table data object "USER1"."TABLE1" failed to load/unload and is being skipped due to error:
    ORA-00933: SQL command not properly ended
    Master table "SYS"."SYS_EXPORT_TABLE_03" successfully loaded/unloaded
    Dump file set for SYS.SYS_EXPORT_TABLE_03 is:
      /oracle/data_15/db1/TABLE1.dmp
    Job "SYS"."SYS_EXPORT_TABLE_03" completed with 1 error(s) at 03:03:58Version
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

    Hello,
    You should use parameter file.Another question i can see you are using 11g.Why don't you use data pump?.
    Data Pump is faster and have more features and enhancement than regular imp and exp.
    You can do the following:
    sqlplus / as sysdba
    Create directory DPUMP_DIR3  for 'Type here your os path that you want to export to';then touch a file:
    touch par.txt
    In this file type the following the following :
    tables=schema.table_name
    dumpfile=yourdump.dmp
    DIRECTORY=DPUMP_DIR3
    logfile=Your_logfile.log
    QUERY =abs.texp:"where hiredate>'01-JAN-13' "then do the following
    expdp username/password parfile='par.txt'
    If you will import from Oracle 11g to version 10g then you have to addthe parameter "version=10" to the parameter file above
    BR
    Mohamed ELAzab
    http://mohamedelazab.blogspot.com/

Maybe you are looking for

  • MRKO: Document types WA impact Partner Profit center

    Hello dear all, This concern consigned inventory.When there is a consumption , it impacts the inventory and a WA document is created (an accrual). The accountants have to launch the MRKO to invoice the consumption (invoice document MRKO) and reverse

  • MacBook Pro freezes often...

    I have a MacBook Pro that freezes pretty often. Sometimes it will restart by itself. I'm running Lion, and I don't recall these problems before I installed that OS. Any thoughts?

  • How do I insert video into my webpage?

    I am using Dreamweaver 8. I have taken my camcorder video and uploaded it to youtube and copied the mp4 file to my hard drive. I have created a page with several videos on the page. I created a screenshot of the video and sized it to the appropriate

  • Why does "Â" show up in image title after export?

    This drives me nuts. When exporting files, the title changes on my images. The character "Â" appears within the title of my image. It's doesn't appear when I look under Library>Metadata. So everytime I use the exported files on my blog, I need to go

  • Color profiles not shown on colorsync

    Hello... I have been looking for a solution to this issue for the last 2 weeks without success... may be somebody knows about it ? Using Mac Os 10.4.11 on an Intel based Mac recently formatted (with the original cd), the color profiles existing on th