WRONG QUERY RESULT WITH REPORTQUERIES AS SUBQUERIES

hi,
i create a ReadAllObject - Query with
a ReportQuery as SubQuery.
when execute the query the result at the SubQuery
contains the data from the database.
the result does not contain the change of these
data in memory of the aplication.
method public void conformResultsInUnitOfWork()
has no effect
i have a simple example
public class A{
private int id;
private String name;
private Collection B = new ArrayList();
public class B{
private int id;
private String name;
private C c ;
public class C{
private int id;
private String name;
and the query is
ReadAllQuery query = new ReadAllQuery();
query.setReferenceClass(A.class);
ReportQuery subQuery = new ReportQuery(A.class, subQueryEb);
subQuery.addAttribute("id");
subQuery.setSelectionCriteria(eb.anyOf("B").get("C").get("name").equal("Test")));
query.querysetSelectionCriteria (eb.get("id").notExists(subQuery));

Conforming subqueries and report queries are not supported in memory. You should be getting an exception thrown stating this.
Your code does not show the call to conform, make sure it is on the root query, not the subquery.

Similar Messages

  • Script for Save Options- Save Query Results with document

    Hi,
    Is there any javascript for Save query results with document in save options? If so where can i find that?
    Thanks
    Kalai

    hi guys,
    I found the answer.The following example shows you how to save the results with the query
    section named “SalesQuery”.
    ActiveDocument.Sections["SalesQuery"].SaveResults=true

  • Numbering query results with a line number in SQL*Plus

    Doesn't it stand to reason that in SQL*Plus there would be a way to number each query results sequentially with line numbers starting at 1 to n -- something option like from a SET command? I'm not talking about linesize.

    There's a column rownum the engine adds into the result sets, just add it to the select list. Can use it to limit the result set (with some limitations) i.e.:
    select rownum, ... from ... where rownum <= 100
    Can't use ">=", that condition will never be met but a subset could be used:
    select * from ( select rownum as linenr, tab1.* from ... ) where linenr between 10 and 20

  • Incorrect query results with conformResultsInUnitOfWork

    Hi,
    has anybody experienced this:
    Take two classes User and Group
    Group has a 1:n Mapping to User (attribute users)
    User has a 1:1 Mapping to User (attribute partner).
    Following query returns too many objects
    User user1 = someUserObject;
    ReadAllQuery readAllQuery = new ReadAllQuery(Group.class);
    Expression e = builder.anyOf("users").get("partner").equal(user1);
    readAllQuery.setSelectionCriteria(e);
    readAllQuery.conformResultsInUnitOfWork();
    Vector vector = (Vector) unitOfWork.executeQuery(readAllQuery);
    It returns
    - the correct Group object as determined from the sql query +
    - any other objects of the same class that are fully instantiated (users is instantiated and for each user, partner is instantiated), even if they don't conform to the expression.
    The same query works properly ;
    - without conformResults
    - or if the other objects are not fully instantiated

    Hi,
    we need an workaround badly and the support is moving at exactly the rate I feared it would.
    So I thought, since we only hit this bug with existing objects and we use conformResultsInUnitOfWork because we want to find the newly created objects, is there a way to get
    - the SQL Query results
    + any new objects that conform to the query
    We still might get new objects that don't conform to the query (this is the bug) but I'll worry about that later if it happens.
    My first attempt at a solution looks like this:
    1. turn off conformResults
    2. manually add all new objects that conform to the query
    I had to guess a little for 2, since I don't know what exactly toplink does to select the "conform" objects.
    private static List findConformNewObjects(UnitOfWork unitOfWork, ReadAllQuery query) {
    List result = new ArrayList();
    Class resultClass = query.getReferenceClass();
    Expression selectionCriteria = query.getSelectionCriteria();
    Enumeration enumeration;
    IdentityHashtable newObjectsCloneToOriginal = unitOfWork.getNewObjectsCloneToOriginal();
    if (newObjectsCloneToOriginal != null && newObjectsCloneToOriginal.size() > 0)
    enumeration = newObjectsCloneToOriginal.keys();
    while (enumeration.hasMoreElements())
    Object o = enumeration.nextElement();
    if (resultClass.isInstance(o))
    if (selectionCriteria != null && selectionCriteria.doesConform(o, unitOfWork, null, query.getInMemoryQueryIndirectionPolicy()))
    result.add(o);
    return result;
    Does this look OK to you? Is there a better way to do it?
    Ana

  • Copy BW query results with formatting

    When copying a query's results to another workbook, the formatting (namely coloring) changes.  Is there any way to copy the query results to a new workbook and keep the exact same formatting as in original query?

    One way to do this would be to copy the worksheet with the results to the other workbook, as follows:
    Edit --> Move or copy sheet... --> change "To book:" to the 2nd workbook --> check "Create a copy" option --> OK
    After doing that, you can cut & paste from the copied worksheet to other worksheets in the workbook, if necessary, and the formatting will be maintained.
    Hope this helps...
    Bob

  • SQL Query Result with Random Sorting

    Hi Experts,
    My Oracle Version : Oracle9i
    I have three tables which are given below,
    Table Name:     check_team
    team_id      team_code
    100          A
    101          B
    102          C
    103          D
    Table Name:     check_product
    product_id     product_code
    1          XXX
    2          XYZ
    Table Name:     check_team_products
    tprod_id     tprod_team_id     tprod_product_id
    1          100          1
    2          100          2
    3          101          1
    4          101          2
    5          102          1
    6          102          2
    7          103          1
    8          103          2
    Required Output First Time:
    team_id   team_code   product_id   product_code
    100       A           1             XXX
    101       B           2             XYZ
    102       A           1             XXX
    103       B           2             XYZ
    Required Output Second Time:
    team_id   team_code   product_id   product_code
    100       B           2             XYZ
    101       A           1             XXX
    102       B           2             XYZ
    103       A           1             XXXI need the result as Required Output specified above and also the result has to be random too.. Can someone help me in writing a SQL Query to get results as that?
    Added Oracle Version

    So, is it something like this you want?
    SQL> ed
    Wrote file afiedt.buf
      1  with check_team as (select 100 as team_id, 'A' as team_code from dual union all
      2                      select 101, 'B' from dual union all
      3                      select 102, 'C' from dual union all
      4                      select 103, 'D' from dual)
      5      ,check_product as (select 1 as product_id, 'XXX' as product_code from dual union all
      6                         select 2, 'XYZ' from dual)
      7      ,check_team_products as (select 1 as tprod_id, 100 as tprod_team_id, 1 as tprod_product_id from dual union all
      8                               select 2, 100, 2 from dual union all
      9                               select 3, 101, 1 from dual union all
    10                               select 4, 101, 2 from dual union all
    11                               select 5, 102, 1 from dual union all
    12                               select 6, 102, 2 from dual union all
    13                               select 7, 103, 1 from dual union all
    14                               select 8, 103, 2 from dual)
    15  --
    16  -- end of test data
    17  --
    18  select team_id, team_code, product_id, product_code
    19  from (
    20        select t.team_id, t.team_code, p.product_id, p.product_code
    21              ,row_number() over (partition by team_id order by dbms_random.random()) as rn
    22        from check_team t join check_team_products tp on (tp.tprod_team_id = t.team_id)
    23                          join check_product p on (p.product_id = tp.tprod_product_id)
    24       )
    25* where rn = 1
    SQL> /
       TEAM_ID T PRODUCT_ID PRO
           100 A          2 XYZ
           101 B          1 XXX
           102 C          2 XYZ
           103 D          1 XXX
    SQL> /
       TEAM_ID T PRODUCT_ID PRO
           100 A          2 XYZ
           101 B          1 XXX
           102 C          2 XYZ
           103 D          1 XXX
    SQL> /
       TEAM_ID T PRODUCT_ID PRO
           100 A          1 XXX
           101 B          2 XYZ
           102 C          1 XXX
           103 D          1 XXX

  • Incorrect query result with Top N condition and two structures

    Hi,
    I have created a query on a FI-GL infocube with the characteristic 0BUS_AREA in rows and two structures in columns. The first structure has two items / selections (each item is a selection of several GL accounts). The second structure has two items (the first one contains the key figure 0BALANCE for the current period and the second item is a formula that calculates the absolute value of the first item. The first item is hidden). The (simplified) result looks like this (sorry, not very pretty!):
    Business Area Clients Clients fae
    Business Area1 10 15
    Business Area2 20 7
    Business Area 3 15 8
    Overall result 45 30
    I then added one condition using the Top N operator. The condition is defined for all the elements of the structures. When I execute the query, I sometimes obtained an incorrect number of Top N records selected. The problem seems to occur when N is greater than the number of available Business Areas for an element of the structure.
    For example, if N = 8 and data only exists for 5 Business Areas for the structure element Clients, I may end up with 10 Business Areas for the second structure element Clients fae when I only expect 9 (i.e. the top 8 Clients fae + 1 of the Top 8 Clients for which there is no data under Clients fae).
    Has anybody encoutered that kind of problem ?
    Many thanks.
    François.

    Pascal,this is a known behavior with conditions.When you apply condition it just hide the extra rows and it does not impact the result row.So your result row actually shows the value irrespective of the condition you apply.
    Now with the help of local functions like calculate result as summation you can show the correct sum after applying the condition but when you try to use that result in some calculation then it takes the original value thereby discarding the calculated value.
    Same is happening in your case as well.Its taking the original value i.e 350 and not the calculated sum after condition i.e 270.
    Hope this helps.
    Regards,
    AL

  • Problems in query result with infoset and timedep infoobject

    Hi,
    I have the following situation:
    infoobject ZEMPLOYEE timedep
    Infocube 0C0_CCA_C11 (standard cost center/cost element postings)
    -> infoset with infoobject and infocube linked with outer join
    My query should show all active employees in one month without any posting in the infocube.
    My testdata looks like this:
    pernr date from    date to         cost center
    4711  01.01.1000 31.12.2002
    4711  01.01.2003 31.01.2009   400000
    4711  01.02.2009 31.12.9999
    That means the employee is only active between 01.01.2003 and 31.01.2009.
    I expect the following result in the query with key-date 31.01.2009:
    4711  01.01.2003 31.01.2009   400000
    I expect the following result in the query with key-date 01.02.2009:
    no result
    -> because the employee is not active anymore, I don't want to see him in the query.
    My query delivers the following result:
    4711  01.02.2009 31.12.9999
    The first and the last entry in master data is automatically created by the system.
    I tried to exclude the not active employees by selection over cost center in the filter (like cost center between 1 and 9999999, or exclude cost center #). But unfortunately the filter selection does not work, because obviously the attributes are not filled in the last entry.
    Is there anyone who can tell me how I can exclude the last entry in the master data in the query?
    Any help is much appreciated! Points will be assigned!
    best regards
    Chris

    HI,
    problem is that I can't use employe status in this case, beacuse for any reason the people don't use it.
    I have also tried with exceptions and conditions, but the attributes ar enot filled, so it seems that nothing works.
    Do you have any other suggestions?
    Thanks!
    best tregards
    Chris

  • Question about different query results with wildcard

    Hi, I'm working with a third party app on SQL Server 2000, and from what I can gather, programmed in C# & VisualFoxPro.
    When we search with
        Note contains 94949
    we get 571 results, when we search with
        Note contains 94949*
    we get 575 results.
    There should be at least a hundred different entries that start with "94949-1" so I expected the query with the wildcard to return something like 680 results, not an additional four rows.
    Searching with
        Note contains 94949-1*
    got 483 results
        Note contains 94949-10*
    got 0 results
    Could someone explain or point me to more documentation on the difference results we get?
    Thanks

    Hi Arnie, thanks for your response.
    My situation is more basic than what appears in your example. Unfortunately, I am working solely through this application so I do not have access to the SQL to test out what you supplied, so my question is more of a need for an explanation of the search results. I do find lots of references to LIKE, Wildcards and pattern matching, but I don't find a way to explain to the users the best and most complete way to search. They mostly need a "this will always get us the results without missing anything" search technique and then to be able to select from a smaller group. I guess I need a basic course in understanding search results: how to get different ones and what they mean.
    Using 
            Note contains 94949-'%'
    returned one more result than when using an asterisk. I don't understand this difference.
            Note contains 94949-'%1'   or
            Note contains 94949-'1%'
    brings nothing nor does not using quotes. But there are hundreds of records which have the string starting with 94949-1 and a varying number of characters after that.
    ?Does the dash read not as a character in the string but as an expression?
    When I use WITHIN 3 characters, I get too few results (eight). If I use AND, I get text unrelated to the account number I am looking for.
    Again when I tried to narrow the search by adding one digit to the string to be matched, I did not get any results, but 500 results from the more general search is too much to scan by opening individual records.
    Thanks for pondering this with me.

  • Combine two Query Results with Rank

    Dear All,
    I am business analyst working DB for first time:
    I have two queries:
    1)
    select * from (select "CAFNo","ActionDate","ActionDetail", rank() over (partition by "CAFNo" order by "ActionDate") rnk,
    from "ABC"
    where "ActionDetail"
    like 'CRF successfully submitted and routed to Fulfillment Team%')
    where rnk=1
    Results in
    CAFNo","ActionDate1","ActionDetail"
    2)
    select * from (select "CAFNo","ActionDate","ActionDetail", rank() over (partition by "CAFNo" order by "ActionDate") rnk
    from "ABC"
    where "ActionDetail"
    like '%Customer ID%')
    where rnk=1
    Results in
    CAFNo","ActionDate2","ActionDetail"
    I would like to combine results of two as:
    CAF no, Actiondate1, actiondate2,ActionDetail
    I tried full outer join and other options but with no success. Please help
    Please share concept of joining the two results not the actual query.

    Actually, my query is not equivalent to original. I missed ActionDetail can be something like:
    'CRF successfully submitted and routed to Fulfillment Team A by Customer ID X'Then it fits both LIKE conditions. If such case of ActionDetail is possible then:
    with t as (
                select  *
                  from  (
                         select  1 weight,
                                 "CAFNo",
                                 "ActionDate",
                                 "ActionDetail",
                                 rank() over (partition by "CAFNo" order by "ActionDate") rnk
                           from  "ABC"
                           where "ActionDetail" like 'CRF successfully submitted and routed to Fulfillment Team%'
                  where rnk=1
               union all
                select  *
                  from  (
                         select  2 weight,
                                 "CAFNo",
                                 "ActionDate",
                                 "ActionDetail",
                                 rank() over(partition by "CAFNo" order by "ActionDate") rnk
                           from  "ABC"
                           where "ActionDetail" like '%Customer ID%'
                  where rnk=1
    select  "CAFNo",
            max(
                case weight
                  when 1 then "ActionDate"
                end
               ) "ActionDate1",
            max(
                case weight
                  when 2 then "ActionDate"
                end
               ) "ActionDate2",
            max(
                case weight
                  when 1 then "ActionDetail"
                end
               ) "ActionDetail1",
            max(
                case weight
                  when 2 then "ActionDetail"
                end
               ) "ActionDetail2"
      from  t
      group by "CAFNo"
    /SY.

  • Wrong query result

    Hi,
    I have an issue with the key figures (Net value total) defined in my query when there are multiple rows for a sales document/item. Here is the scenario which explains the problem.
    Salesdoc Itemno net value sold to contact ID
    3200 10 3000 ST0001 CT0001
    3200 10 3000 ST0001 CT0002
    3200 10 3000 ST0001 CT0003
    Base on the above scenario, if I run the query and see the result for the Net value total of a sales document, it is showing up as $9000 (as there are 3 contact ID’s). The contacts are actually stored in a different ODS object. And this ODS object has been linked to the sales ODS object using an Infoset. And the query built on this infoset is causing this issue.
    Please let me know if there is any workaround for this issue (The above scenario I mentioned is the result of the info set after combining data from Contact ODS and Sales ODS. And I don’t want to store the data in a separate ODS keeping the net value as $3000 for the first row and 0’s for the rest of the two rows, to resolve this issue).
    Appreciate your help on this!
    Thanks
    MM.
    Message was edited by: tony

    i have a very simple example.
    public class Simple {
    private Integer id;
    private String text;
    public Integer getId() {
    return id;
    public void setId(Integer id) {
    this.id = id;
    public String getText() {
    return text;
    public void setText(String text) {
    this.text = text;
    and the query is
    ReadObjectQuery query = new ReadObjectQuery();
    query.setReferenceClass(Simple.class);
    query.conformResultsInUnitOfWork();
    Simple simple = new Simple();
    simple.setText("c");
    query.setExampleObject(simple);
    the database tabel has 5 rows
    1,a
    2,b
    3,c
    4,a
    5,a
    before i execute the query i change the text
    from the simple object ( from "c" to "x")
    after execute
    i get the object with id 5 and text "a"

  • Wrong query results: due to date format?

    hello,
    I have oracle 11 and when I execute this query:
    select MYDATE from mytable order by MYDATE DESC;
    it get me a bad order:
    MYDATE
    25-MAR-09
    13-MAR-09
    10-MAR-10
    10-MAR-10
    31-JAN-10
    29-JAN-10
    28-JAN-10
    08-DEC-09
    07-DEC-09
    06-DEC-09
    05-DEC-09
    is it may due to a wrong date format?
    where have I to look out? init.ora?

    But, there is no problem at my end (Using Oracle 10.2.0.1 on win xp):
    SQL> create table t(mydate date);
    Table created.
    SQL> insert into t values(to_date('25-MAR-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('13-MAR-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('31-JAN-10','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('07-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('05-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('06-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('08-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('10-MAR-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('29-JAN-10','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('10-MAR-10','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('28-JAN-10','DD-MON-YY'));
    1 row created.
    SQL> select * from t;
    MYDATE
    25-MAR-09
    13-MAR-09
    31-JAN-10
    07-DEC-09
    05-DEC-09
    06-DEC-09
    08-DEC-09
    10-MAR-09
    29-JAN-10
    10-MAR-10
    28-JAN-10
    11 rows selected.
    SQL> SELECT MYDATE FROM T ORDER BY MYDATE DESC;
    MYDATE
    10-MAR-10
    31-JAN-10
    29-JAN-10
    28-JAN-10
    08-DEC-09
    07-DEC-09
    06-DEC-09
    05-DEC-09
    25-MAR-09
    13-MAR-09
    10-MAR-09
    11 rows selected.
    SQL> SHOW PARAMETER NLS_DATE;
    NAME                                 TYPE        VALUE
    nls_date_format                      string
    nls_date_language                    stringCan you show us the output of
    show parameter nls_date;
    Regards
    Girish Sharma

  • SQL query result with HTML Data in output

    Hello,
    I have a SQL table , in one column I store HTML data. I need to query the table and get the HTML data in the columns that have 'HREF'. The output shows as grid on the sql management studio, however when I export it to excel, the HTML data does not get copied
    correctly, since there are HTML tags etc.
    How can I export the report correctly from SQL ?

    Hello,
    The HTML data is stored in a column with datatype as nvarchar(max). Sample data in the column is shown below. It is with formatting etc and is rendered as is on the web page. the business wants to generate a quick report so that they can see the pages that
    have links displayed. I can do that by querying the columns that have a 'HREF' in the text.
    Can I get the exact HREF values using just sql query? There can be more than one links on a page.
    Also, If I just want to copy the whole column and paste it on excel, how can I do that? If I copy the data below and paste, it does not get copied in one cell.. it spreads across multiple cells, so the report does not make any sense.
    <br />
    <table border="0" cellpadding="0" cellspacing="0" style="width: 431pt; border-collapse: collapse;" width="574">
    <tbody>
    <tr height="19" style="height: 14.25pt; ">
    <td height="19" style="border: 0px blue; width: 431pt; height: 14.25pt; background-color: transparent;" width="574"><a href="https:"><u><font color="#0066cc" face="Calibri">ax </font></u></a></td>
    </tr>
    </tbody>
    <colgroup>
    <col style="width: 431pt; " width="574" />
    </colgroup>
    </table>

  • Need to hide rows in the Query results with blank values

    Hi All,
    We have a requirement like this for Stock Report, we need to display both movements and balance in that report. We display the movement data directly from the Standard cube with input as Fiscal period/year.  When we do like this, we are not able to get the opening balance as fiscal period was in char restrictions pane.
    We have created a dummy keyfigure restricted to Fiscal period ( so that the global filter is not applied and get the inventory data irrespective of fiscal period input ). We have created 3 variables of processing type customer exit and acheived calculating opening balance, current movement and closing balance.
    If FP input is 009.2010 to 010.2010, it will get whatever Qty moved before 009.2010 ( 001.1990 - 009.2010 in exit ) as opening balance and closing balance ( 001.1990 - 010.2010 )  and the Qty KF restricted with another exit varibale ( 009.2010 to 010.2010 ).
    Hope everyone understood the scenario and issue here is, though I give the input 009.2010 - 010.2010 , I get the rows displayed for different periods ( this is because I am retreiving data for all the fiscal periods but restricting it based on input ). How to restrict/hide these rows.
    Your inputs and suggestions are valued.
    Thanks,
    Chandra.

    Hi,
    Try creating a query level field which would populate as "X" (with the IF condition ) if the record falls in the period which you have given for input variable (009.2010 - 010.2010). Then place a query level filter for this field where only records with value "1" for this field is displayed.
    Hope this helps.
    Happy to help further.
    Regards
    Venky

  • Query Result with pagination problem

    I have a region that has a search field with a "Go" button which runs a report based on a SQL Query(PL/SQL function body returning SQL query). Works great and displays the default of 15 rows with a pagination scheme of "Row Ranges X to Y of Z(with pagination)". The problem is that when I click on the "Next rows ... " link the screen goes blank and I have to click on the "Go" button before it displays the next 15 rows. How do I get around this problem of having to click on the "Go" button?
    thanks
    John

    Hi John,
    I am also facing the same problem. Any solution has been found out by you.
    If so, please give it in the forum know.
    Thanks in advance
    kavitha l

Maybe you are looking for

  • Latest version of Itunes for Windows Error 45075 Missing Componet

    I have had no problem with my IPad or Itunes for a year. Till today. I was moving Itunes from internal C drive to D. Freeing up space. It was suggested that I just uninstall and reinstall in new drive with clean copy from Itunes direct. So each time

  • HP Pavilion Hard Drive Question

    Is there any way I can add a second hard drive to my HP Pavilion dv7-3165dvx laptop?  There's a second drive bay, but no connections.

  • Word Wrapping?

    I use OCR text recognition to rip large amounts of Text from scanned books. When I copy and paste into Pages I am left with text with huge gaps that needs to be edited. Is there a way around having to hit the backspace button to back each line up to

  • Having trouble listening to podcast......suddenly

    Windows XP can anyone help? after listening to a podcast daily, suddenly i get the following prompt when trying to download the last show, or any show for that matter: "There was a problem downoading "FTL2006-03-07". You do not have any access privil

  • Title trouble - did I lose my favourites with 08?

    Seems like the 08 imovie has a very limited title menu. I like to have a black screen with text in between the video clips, but I can´t find the function anymore. Or is it still there somewhere? I also miss the typewriter style. Is that one gone too?