Read consistency with compound query

Does read consistency work for the whole compound query or does it work only for every single query in the compound query ?
I mean if I issue the following statement
select * from TABLE
union all
select * from TABLE
if in the mean time an update has taken place on the table by an other session and also a commit is it possible that the second part of the union query to see that update ?
Thanks

My real life problem is the following:
I have a movements table and an online_stoc table, I keep the online_stoc table sincronized with the movements table using a trigger on the movements table.
When I issue a statement
select item, sum(qta_din), sum(qta_sta)
from
select item, sum(qta) qta_din, 0 qta_sta
from movements
group by item
union all
select item, 0 qta_din, qta qta_sta
from online_stoc
group by item
having sum(qta_din) <> sum(qta_sta)
it should not give anny rows back and I almost always see this correct result.
But I experienced one time that this query gave back a line and after a checking I saw that during the query execution time there was an insert transaction on the table movements that commited during te query.
So I don't understand how was it possible.
Thanks

Similar Messages

  • Need help with compound query

    I have a group of four tables that I need to query. Here are the 4 tables:
    <br>
    CREATE TABLE "APP_ATS"."BOX_INFORMATION" <br>
    (     "REC_COUNT_PK" NUMBER(7,0), <br>
         "BOX_ID" NUMBER(5,0), <br>
         "CUSTODIAN_SAP_NUMBER" VARCHAR2(5), <br>
         "FACILITY_KEY_FK" NUMBER(3,0), <br>
         CONSTRAINT "APP_ATS__BOX_INFORMATION__PK" PRIMARY KEY ("REC_COUNT_PK"),<br>
         CONSTRAINT "APP_ATS__BOX_INFO__FACIL__FK" FOREIGN KEY ("FACILITY_KEY_FK")<br>
         REFERENCES "APP_ATS"."FACILITY_DATA" ("FACILITY_KEY_PK") ENABLE)<br>
    <br>
    CREATE TABLE "APP_ATS"."FACILITY_DATA" <br>
    (     "FACILITY_KEY_PK" NUMBER(3,0), <br>
         "FACILITY_NAME" VARCHAR2(100), <br>
         CONSTRAINT "APP_ATS__FACILITY_DATA__PK" PRIMARY KEY ("FACILITY_KEY_PK"))<br>
    <br>
    CREATE TABLE "APP_ATS"."EMP_WORK_INFO"<br>
    (     "EMPLOYEE_NUMBER" varchar2(5), <br>
         "LAST_NAME" varchar2(50), <br>
         "PREFERRED_NAME" varchar2(50)) <br>
    <br>
    CREATE TABLE "APP_ATS"."BOX_CONTENT_GROUP_INFORMATION" <br>
    (     "CONTENT_KEY_PK" NUMBER(6,0), <br>
         "REC_COUNT_FK" NUMBER(7,0), <br>
         "BOX_ID_FK" NUMBER(5,0), <br>
         "GROUP_DESCRIPTION" VARCHAR2(1999 BYTE), <br>
         "GROUP_COUNTER" NUMBER(4,0), <br>
         CONSTRAINT "APP_ATS__BOX_CONT_GRP_INFO__PK" PRIMARY KEY ("CONTENT_KEY_PK"),<br>
         CONSTRAINT "APP_ATS__BX_C_G_INF__BX_ID__FK" FOREIGN KEY ("REC_COUNT_FK")<br>
         REFERENCES "APP_ATS"."BOX_INFORMATION" ("REC_COUNT_PK") ENABLE) <br>
    <br>
    If the box_information table has these records:<br>
    1,1,'00001',1<br>
    2,4,'00002',1<br>
    3,2,'00003',2<br>
    <br>
    The facility_data table has these records:<br>
    1,'County Records'<br>
    2,'DataStor'<br>
    <br>
    The Emp_Work_Info table has:<br>
    '00001','Jones','Fred'<br>
    '00002','Grobnik','Igor'<br>
    '00003','Marley','Bob'<br>
    <br>
    The box_content_group_information has:<br>
    1,1,1,'first box group 1',1<br>
    2,1,1,'first box group 2',2<br>
    3,2,4,'fourth box group 1',1<br>
    4,3,2,'second box group 1',1<br>
    <br>
    I need a query that returns a record set that looks like this:<br>
    BoxID,Preferred_Name,last_name,facility_name,descriptions<br>
    1,Fred,Jones,County Records,first box group 1|-|first box group 2<br>
    2,Bob,Marley,DataStor,second box group 1<br>
    4,Igor,Grobnik,County Records,fourth box group 1<br>
    <br>
    Since the first 3 tables have a 1 to 1 relationship I can get that part working fine with this:<br>
    <br>
    select Box_ID, EMDS_PREFERRED_NAME, EMDS_LAST_NAME, FACILITY_NAME<br>
    FROM App_ATS.Facility_Data, App_ATS.Box_Information, EMP_WORK_INFO<br>
    WHERE App_ATS.Facility_Data.Facility_key_PK = App_ATS.Box_Information.Facility_key_fk<br>
    AND App_ATS.Box_Information.CUSTODIAN_SAP_NUMBER = EMP_WORK_INFO.EMPLOYEE_NUMBER;<br>
    <br>
    The problem is that for each box_information row I may have multiple BOX_CONTENT_GROUP_INFORMATION rows and I need the record set to
    return only one row per box_information row.<br>
    <br>
    I found a function that concatenates a single field from multiple rows into a single string but it isn't designed to group on any particular field so if I use it each record has all of the descriptions instead of only those for that box_ID. The function:<br>
    <br>
    create or replace function glue<br>
    ( p_cursor sys_refcursor,<br>
    p_delimiter varchar2 := '|-|') <br>
    return varchar2<br>
    is<br>
    l_value varchar2(32000);<br>
    l_result varchar2(32000);<br>
    begin<br>
    loop<br>
    fetch p_cursor into l_value;<br>
    exit when p_cursor%notfound;<br>
    if l_result is not null then<br>
    l_result := l_result || p_delimiter;<br>
    end if;<br>
    l_result := l_result || l_value;<br>
    end loop;<br>
    return l_result;<br>
    end glue;<br>
    <br>
    **It was called join but I like glue better, join is a key word. Thanks to whomsoever came up with it.<br>
    <br>
    Please help me figure out how to do this!<br>

    Right. Listing the table creation scripts, each row of data for each table and then the snapshot of what I expect isn't enough, it has to be an actual set of insert statements? Here they are then:
    Insert into app_ats.box_information (REC_COUNT_PK, BOX_ID, CUSTODIAN_SAP_NUMBER, FACILITY_KEY_FK) Values (1,1,'00001',1);
    Insert into app_ats.box_information (REC_COUNT_PK, BOX_ID, CUSTODIAN_SAP_NUMBER, FACILITY_KEY_FK) Values (2,4,'00002',1);
    Insert into app_ats.box_information (REC_COUNT_PK, BOX_ID, CUSTODIAN_SAP_NUMBER, FACILITY_KEY_FK) Values (3,2,'00003',2);
    Insert into app_ats.facility_data (FACILITY_KEY_PK, FACILITY_NAME) values (1,'County Records');
    Insert into app_ats.facility_data (FACILITY_KEY_PK, FACILITY_NAME) values (2,'DataStor');
    Insert into app_ats.Emp_Work_Info (EMPLOYEE_NUMBER, LAST_NAME, PREFERRED_NAME) values ('00001','Jones','Fred');
    Insert into app_ats.Emp_Work_Info (EMPLOYEE_NUMBER, LAST_NAME, PREFERRED_NAME) values ('00002','Grobnik','Igor');
    Insert into app_ats.Emp_Work_Info (EMPLOYEE_NUMBER, LAST_NAME, PREFERRED_NAME) values ('00003','Marley','Bob');
    Insert into app_ats.box_content_group_information (CONTENT_KEY_PK, REC_COUNT_FK, BOX_ID_FK, GROUP_DESCRIPTION, GROUP_COUNTER) values (1,1,1,'first box group 1',1);
    Insert into app_ats.box_content_group_information (CONTENT_KEY_PK, REC_COUNT_FK, BOX_ID_FK, GROUP_DESCRIPTION, GROUP_COUNTER) values (2,1,1,'first box group 2',2);
    Insert into app_ats.box_content_group_information (CONTENT_KEY_PK, REC_COUNT_FK, BOX_ID_FK, GROUP_DESCRIPTION, GROUP_COUNTER) values (3,2,4,'fourth box group 1',1);
    Insert into app_ats.box_content_group_information (CONTENT_KEY_PK, REC_COUNT_FK, BOX_ID_FK, GROUP_DESCRIPTION, GROUP_COUNTER) values (4,3,2,'second box group 1',1);
    There you go! Now everyone has the full set of scripts as well as the expected output. I anxiously await your brilliant solution.

  • Read consistency in query with pl/sql functions

    Not sure if this is a bug or feature, but a query containing a user-defined pl/sql function does not include tables accessed within the pl/sql function in the read consistent view of data, eg
    select myfunc from tableA
    myfunc is a stored function that queries tableB and returns a value
    If a change to tableB is committed in another session during fetch phase of select statement, then fetched rows reflect the changes. The database does not recognise tables accessed in the plsql function as being part of the query.
    This happens in 7.3.4 and 8.1.6. Don't have 9i so can't tell.
    Anyone know if this is a bug or feature?
    Aside: you can also drop the plsql function whilst the fetch is running. It will kill the fetch. No DDL lock taken on the plsql function whilst select is running! Seems wrong.

    I don't know Forms but I know SQL*Plus and Oracle database. Normally PL/SQL running on the database can only access files on the host where the database instance is running even if you start PL/SQL with a SQL*Plus connection from another host.
    PL/SQL runs only the database instance not on the client side even if you start the PL/SQL code from a remote connection with SQL*Plus.

  • Content Tab: None of the fact tables are compatible with the query request

    Hi All,
    **One thing I am not clear yet of all my years with OBIEE is working with the content tab in BMM.**
    I have made a rpd the joins in physical layer as shown below:
    https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056545119428530
    And the BMM layer as:
    https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056519553812930
    Error I am getting when i run a request from the 3 columns from the selected 3 tables is:
    Dim - Comment Code Details
    Fact - Complaint
    Dim - Service Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14020] None of the fact tables are compatible with the query request Sr Num:[DAggr(Fact - Complaint.Sr Num by [ Dim - Service Details.Sr Cat Type Cd, Dim - Comment Code Details.Cmtcode name] )]. (HY000).
    I get no error for consistency.. I read everywhere and I know i need to set the appropriate aggregation levels in the various dims and facts LTS properties to help OBIEE understanding our model, but how to do that.. how do i decide... how should I approach, what should be the aggregation level, what details.
    When i click More button i see different options: Copy, Copy From, Get Levels, Check Level, what do these mean.
    Aggregation Content, group by - Logical Level or Column which one should i choose and how should I decide.
    Can anyone explain the Content Tab in details and from scratch with some example and why we get these errors.... I know many people who are well versed with many other things related to RPD but this. A little efforts of explaining from you guys will really be appreciated.
    Thanks in advance,
    Dev

    Hi Deepak,
    Option 1:
    My tables in physical layer are joined as below:
    D1--> F1 <--D2--> F2 <--D3
    Same way i model it in BMM
    D1--> F1 <-- D2--> F2 <--D3
    Here D1 is non Conformed Dimension for F2 and D3 is non Conformed dim for F1. Later create Dimensional hierarchies, I tried setting up the content levels
    I go Sources>content tab of Fact F1 I set
    Dimensions----------- Logical level
    D1---------------------- D1 Detail
    D2---------------------- D2 Detail
    D3---------------------- D3 Total
    then, I go Sources>content tab of Fact F2 I set
    Dimensions----------- Logical level
    D1---------------------- D1 Total
    D2---------------------- D2 Detail
    D3---------------------- D3 Detail
    Then, I also go in all the dimensions and set their content levels to Details, but it still gives me errors not sure where I am going wrong in setting the content levels.
    I need to know whether the way I have modeled it in BMM is right,
    Option 2:
    I can combine the two facts in a single Logical Fact or the above design should also work.
    (F1&F2)<--D1, D2 , D3 joined separately using complex logical joins.
    what will be the content tab details?
    Thanks,
    Dev

  • Crystal Report with Compound Key

    Hi,
    I have Characteristic with Compound Key in SAP BW 7.0. This Characteristic use to store the Purchase Order Item Line. The Compound Key is the Purchase Order Document.
    So I will have the following fields created for this Characteristic:
    Compound Key (Purchase Order Document) 5600001982, Purchase Order Item Line 10
    I created a Query for this Characteristic and I have the following as result:
    10 ...
    20 ...
    30 ...
    All works fine.
    Now I created the Crystal Report from this Query. When I display this Characteristic in Crystal Report, I have the following:
    5600001982/10
    5600001982/20
    5600001982/30
    Is this a bug or Crystal not support the Compound Key?
    Please advise, thank you.

    Hello,
    Did you get this resolved.
    Were you able to display characteristics in Crystal without the compounding characteristic.
    Thanks.

  • The rendered records are not consistent with the range

    After changing the range with record navigator to render the records,
    if navigate to other page and go back,the rendered records will not be
    consistent with the record range.
    The issue can be reproduced as follows.
    1.when select 1-10 range,the first 10 records are rendered.
    2.select [Next 10 records] to render the 11-13 records.
    3.change to other page and return to the original page.
    It is found that the 11-13 records are rendered but the range is 1-10.
    You can verify the issue by executing SampleMainPG.xml of the Tutorial.jpr for 11.5.10.2
    from Jdeveloper after changing the SampleMainCO.java as below.
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (pageContext.getTransactionValue("link") != null)
    OAAdvancedTableBean inner = (OAAdvancedTableBean)webBean.findChildRecursive("InnerTable");
    inner.clearCache(pageContext);
    inner.setAttributeValue("CLEAR_CACHE_ONCE_NOEXECUTE_ATTR", Boolean.TRUE);
    <==comment out these original source above.
    OAAdvancedTableBean outer = (OAAdvancedTableBean)webBean.findChildRecursive("OuterTable");
    outer.queryData(pageContext, false);
    <==add the two rows of source above to get the latest query data.
    you should to make the records of the table fwk_tbx_employees to be more than 10 just using the SQL script below.
    (just need to change EMPLOYEE_ID at your will)
    INSERT INTO fwk_tbx_employees (
    EMPLOYEE_ID,
    TITLE,
    FIRST_NAME,
    MIDDLE_NAMES,
    LAST_NAME,
    FULL_NAME,
    EMAIL_ADDRESS,
    MANAGER_ID,
    POSITION_CODE,
    SALARY,
    START_DATE,
    END_DATE,
    LAST_UPDATE_DATE,
    LAST_UPDATED_BY,
    CREATION_DATE,
    CREATED_BY,
    LAST_UPDATE_LOGIN,
    ATTRIBUTE_CATEGORY,
    ATTRIBUTE1,
    ATTRIBUTE2,
    ATTRIBUTE3,
    ATTRIBUTE4,
    ATTRIBUTE5,
    ATTRIBUTE6,
    ATTRIBUTE7,
    ATTRIBUTE8,
    ATTRIBUTE9,
    ATTRIBUTE10,
    ATTRIBUTE11,
    ATTRIBUTE12,
    ATTRIBUTE13,
    ATTRIBUTE14,
    ATTRIBUTE15 )
    VALUES (
    17,
    'ichiro',
    'yamada',
    'ichiro yamada',
    1,
    0,
    sysdate,
    sysdate,
    sysdate,
    0,
    sysdate,
    0,
    0,
    it seems that if use the functions below,the issue can be workarounded.
    But it is not clear whether there is any other impact from these functions.
    innerTable1.clearCache(pageContext);
    innerTable1.setAttributeValue("CLEAR_CACHE_ONCE_NOEXECUTE_ATTR", Boolean.TRUE);
    Could you please share your idea?
    Thank you very much in advance.
    Best regards,
    Wang

    FYI.  I was able to do what I wanted by first going to page properties and removing unwanted fonts from appearance.  Then edit the page, select all, change style to normal, then select the text where you want to use a different style and change style there.  This gives consistent appearance with both browsers.

  • "None of the fact tables are compatible with the query request " error

    I've got a situation where I have two facts(Fact_1, Fact_2) and three dimensions(dim_1,dim_2,dim_3) in 1 subject area. I've got dimension hierarchies setup for all the dimension tables.
    Dim_1 is one to many to Fact_1
    Dim_2 is one to many to Fact_2
    Dim_3 is one to many to both Fact_1 and Fact_2
    I've set up the content levels for the LTS for the Facts so that they are the lowest grain for dimensions they join to and the grand total grain for dimensions they do not join to.
    My rpd is consistent. When I run a report using an attribute from Dim_3 and Dim_1 or Dim_3 and Dim_2, the report comes back fine.
    But if I try to run a report using all three Dim tables, I get an error and the message "None of the fact tables are compatible with the query request ".
    First of all, is it possible to make a report using all three dimensions?
    Second, what's the best way to trouble shoot this error? Why are none of the fact tables compatible? I thought as long as the aggregation levels were set to grand total for non-shared dimensions, Answers would be able to create the report properly.
    Any advise would be greatly appreciated.
    Thanks!
    -Joe

    OBIEE is looking for a fact that can link ALL the dimensions together. This is also known as the implicit fact ... you don't have a fact that can relate all the dimensions - you have 2 facts that together they can. Perhaps you need to great a single logical fact that has both LTS for your physical facts and try it that way.
    Then you'd have Dim1, Dim 2, Dim3 all being able to join to Fact1 (which is made of physical facts 1 & 2).

  • Report with multiple query

    Hi,
    I want to construct a report that consists of results from a number of different queries, I was just wondering how would acheive that if APEX only allows me to return one query?
    Thanks
    Candy

    "which tool does allow you to create one report out of multiple indipendant queries?"
    I don't know which tools allow me to do that, I was hoping there's something like that.
    The report I want to show is something like this, I have a table with a list of customers, each customer has a number of work request(an other table), where some of my team collegaues would spend X amount of time on the work request.
    the report should show something like this for the current week or month:
    company A Michael 5 hrs
    Pete 4 hrs 1 week ago 2 week ago
    total: 9 hrs 7 hrs 17 hrs
    I hope you can see what i am trying to show in my report, basically, it should show for each customer the name of the worker and the hrs he spent, and then the total, that i suppose i can do it with one query:
    select sum(wrs.time), con.first_name, c.full_name
    from customers c,
    work_request wr,
    work_request_state wrs,
    contacts con
    where wrs.request_id = wr.id
    and wr.customer_id = 27
    and c.cust_id = 27
    and wrs.time!=0
    and wrs.changed_date > trunc(next_day(sysdate -7, 'SUN'))
    and wrs.changed_by = con.cont_id
    and con.cust_id = 0
    group by con.first_name, c.full_name
    order by c.full_name;
    but i also want to find out one/two week ago, how many hours were spent, and that's when i need to do a separate query with different where clause.
    If you don't undersatnd my report, I can email the report template to you, so you can see it better in a table.
    Perhaps I just over looked the whole problem...

  • Using join and batch reading in the same query

    Hi,
    I wonder if it is possible to use "Joining" and "batch reading" in the same query.
    For example I Have
    A -> 1-1 B
    A -> 1-1 B
    B -> 1-M C
    This is the case where I have two separate 1-1 relationships to the same class B from A. Toplink 10.0.3 can manage it nicely through joining.
    Now, I would like to read a set of As (with its 2 Bs) and all Cs for each B.
    It seems that the following configuration does not work:
    A -> 1-1 B (use joining)
    A -> 1-1 B (use joining)
    B -> 1-M C (Batch read)
    Any help would be greatly appreciated
    Tony.

    James,
    Would you be so kind to look at the following code?
    Am I formulating it correctly to achieve my desired behavior?
    Trip.class -> 1-1 PickupStop
    Trip.class -> 1-1 DropoffStop
    PickupStop and DropoffStop extend Stop and use same table (STOP)
    Stop -> 1-M StopEvents
    I would like to fetch all Trips, with their Stops and all StopEvents in 2 queries:
    1. Trip joined with Stop
    2. Batchread StopEvents
    Code:
    ReadAllQuery raq = new ReadAllQuery(Trip.class);
    Expression qexp1 = new ExpressionBuilder();
    Expression qexp2 = new ExpressionBuilder();
    raq.addJoinedAttribute("pickupStop");
    raq.addJoinedAttribute("dropoffStop");
    raq.addBatchReadAttribute(qexp1.get("pickupStop").get("vStopEvents"));
    raq.addBatchReadAttribute(qexp2.get("dropoffStop").get("vStopEvents"));

  • Crystal Report and InfoObject with Compound Key

    Hi,
    I have Characteristic with Compound Key in SAP BW 7.0. This Characteristic use to store the Purchase Order Item Line. The Compound Key is the Purchase Order Document.
    So I will have the following fields created for this Characteristic:
    Compound Key (Purchase Order Document) 5600001982, Purchase Order Item Line 10
    I created a Query for this Characteristic and I have the following as result:
    10 ...
    20 ...
    30 ...
    All works fine.
    Now I created the Crystal Report from this Query. When I display this Characteristic in Crystal Report, I have the following:
    5600001982/10
    5600001982/20
    5600001982/30
    Is this a bug or Crystal not support the Compound Key?
    Please advise, thank you.

    a

  • ANY wild Card is not working in MODEL - What is wong with my query?

    Hi Gurus,
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    CREATE TABLE "SALES"
       (     "COUNTRY" VARCHAR2(5 BYTE),
         "PRODUCT" VARCHAR2(5 BYTE),
         "YEAR" NUMBER,
         "SALES" NUMBER
    insert into sales values('A','prod1',2000,10);When I pass the product name in the model calsue I am getting the expected result
    select *
    from sales
    model
    PARTITION BY (country)
    dimension by (product,year)
    measures(sales s)
    rules  upsert
    s['prod1',2001]=s['prod1',2000]*2
    COUNTRY PRODUCT YEAR S
    A       prod1   2000 10
    A       prod1   2001 20 but When I use, ANY, I am not getting the result. What is wrong with my query?
    select *
    from sales
    model
    PARTITION BY (country)
    dimension by (product,year)
    measures(sales s)
    rules  upsert
    s[ANY,2001]=s[cv(product),2000]*2
    COUNTRY PRODUCT YEAR S
    A       prod1   2000 10 Thanks in advance.
    Edited by: 884476 on Oct 29, 2012 12:51 AM
    Please feel free to ask any further details required..

    You need to use UPSERT ALL rather than just UPSERT.
    The documentation [url http://docs.oracle.com/cd/E11882_01/server.112/e25554/sqlmodel.htm#i1011770]here explains that UPSERT can only insert with "positional reference" and not "symbolic reference", and ANY wildcard is always "symbolic reference". But UPSERT ALL allows model rules with existential predicates (comparisons, IN, ANY, and so on) in their left side to have UPSERT behavior.

  • Combining results with a Query of Queries - NOT QUITE THERE!!!

    I have included a small sample of my database, specifically the four tables I am trying to work with in the hopes that someone can steer me down the right path. Here are the four tables and the bottom is a visual desciption of what I am trying to achieve;
    ORDERS
    SALES CALLS
    ID
    SaleDate
    TerritoryManager
    UserID
    SaleDate
    TerritoryManager
    ID
    UserID
    426
    01-Oct-09
    Mike B
    10112
    10/1/2009
    Mike  B
    253
    10112
    427
    01-Oct-09
    Russ  C
    10115
    10/1/2009
    Mike  B
    254
    10112
    430
    01-Oct-09
    Jerry W
    10145
    10/1/2009
    Mike  B
    255
    10112
    432
    01-Oct-09
    Ron  H
    10118
    10/1/2009
    Mike  B
    256
    10112
    433
    01-Oct-09
    Ron H
    10118
    10/1/2009
    Ron  H
    257
    10118
    10/1/2009
    Ron  H
    258
    10118
    PRODUCTS ORDERED
    10/1/2009
    Ron  H
    260
    10118
    OrderID
    Quantity
    NewExisting
    UserID
    10/1/2009
    Russ  C
    261
    10115
    426
    12
    0
    10112
    10/1/2009
    Mike  B
    267
    10112
    427
    2
    0
    10115
    10/1/2009
    Mike  B
    268
    10112
    427
    3
    1
    10115
    430
    1
    0
    10145
    USERS
    430
    1
    0
    10145
    TerritoryManager
    Zone
    UserID
    432
    1
    0
    10118
    Mike B
    Central
    10112
    432
    1
    0
    10118
    Russ  C
    Central
    10115
    432
    1
    1
    10118
    Jerry W
    Central
    10145
    432
    1
    1
    10118
    Ron  H
    Central
    10118
    433
    2
    1
    10120
    Don  M
    Central
    10120
    Central Zone
    Ttl Calls
    Ttl Orders
    Ttl Items
    Ttl New Items
    Mike B
    5
    1
    12
    1
    Russ  C
    1
    1
    5
    Jerry W
    1
    2
    Ron  H
    3
    2
    6
    3
    I have tried to achieve this result in many ways to no avail. If I try to combine PRODUCTS ORDERED with ORDERS I get an erroneous count. I finally resigned myself to getting all the info I needed with separate queries and then trying to combine them with a query of queries. This worked fine until the last query of queries which timed out with no results. I am a newbie and would appreciate any constructive help with this. I am including my queries below as well;
    <cfquery name="qGetOrders" datasource="manna_premier">
    SELECT Count(Orders.ID) AS CountOfID,
           Orders.UserID AS Orders_UserID,
        Users.UserID AS Users_UserID,
        Users.TMName
    FROM Users INNER JOIN Orders ON Users.[UserID] = Orders.[UserID]
    GROUP BY Orders.UserID, Users.UserID, Users.TMName;
    </cfquery>
    <cfquery name="qGetSalesCalls" datasource="manna_premier">
    SELECT Count(Sales_Calls.ID) AS CountOfID,
           Users.UserID AS Users_UserID,
        Users.TMName,
        Sales_Calls.UserID AS Sales_Calls_UserID
    FROM Users INNER JOIN Sales_Calls ON Users.[UserID] = Sales_Calls.[UserID]
    GROUP BY Sales_Calls.UserID, Users.UserID, Users.TMName;
    </cfquery>
    <cfquery name="qGetProducts" datasource="manna_premier">
    SELECT Count(ProductOrders.OrderID) AS CountOfOrderID,
           Sum(ProductOrders.Quantity) AS SumOfQuantity,
        Sum(ProductOrders.NewExisting) AS SumOfNewExisting,
        ProductOrders.UserID
    FROM Orders INNER JOIN ProductOrders ON Orders.[ID] = ProductOrders.[OrderID]
    GROUP BY ProductOrders.UserID;
    </cfquery>
    <cfquery name="qqCombOrd_Prod" dbtype="query">
    SELECT *
    FROM qGetOrders, qGetProducts
    </cfquery>
    <cfquery name="qqCombOrd_ProdtoSales" dbtype="query">
    SELECT *
    FROM qqCombOrd_Prod, qGetSalesCalls
    </cfquery>
    PLEASE HELP!!! I'm about to go scouting for bridges to leap from!

    You might be able to simplify that query by getting rid of the subqueries.  Something like this
    SELECT TerritoryManager
    , count(sc.userid) totalcalls
    , sum(po.quantity) total
    , sum(newexisting) totalnew
    , count(o.userid) totalorders
    from users u join salescalls sc on u.userid = sc.userid
    join orders o on u.userid = o.userid
    join productorders po on u.userid = po.userid
    where userzone = 'CENTRAL'

  • Problem with a query with a BLOB data type

    Hi i've a problem with this query in 11g. R1
    SELECT
          LOGTIMESTAMP,
          LOGTIMEMILLIS,
          MSGID,
          XMLTYPE(MESSAGEBODY, nls_charset_id('AL32UTF8')).getClobVal()  as LLamada
    FROM
        vordel.AUDIT_MESSAGE_PAYLOAD,
        vordel.AUDIT_LOG_POINTS
    WHERE
        AUDIT_LOG_POINTS.LOGPOINTSPK = AUDIT_MESSAGE_PAYLOAD.MP_LOGPOINTSPK AND
        LOGTIMESTAMP between TO_TIMESTAMP('03-12-2011 00:00','DD-MM-YYYY HH24:MI') and  TO_TIMESTAMP('03-12-2011 12:00','DD-MM-YYYY HH24:MI')
         and filtertype = 'LogMessagePayloadFilter'
      and filtername like 'Log Llamada%'MESSAGEBODY: data type of the Column is BLOB
    throw this error after execute the query
    Error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 283
    ORA-06512: at line 1

    Could you check the BLOB really contains UTF-8 encoded XML?
    What's your database character set?The BLOB contains UTF-8 Encoded
    and the database where i am connectes have AL32UTF8 character set, but my internal instance have "AMERICAN_AMERICA.WE8ISO8859P1"
    that is a problem?
    How could I change the character set of the oracle local client to the character set of the remote oracle data base?

  • Essbase answers - None of the fact tables are compatible with the query request "member"

    Hi,
    I have modelled an Essbase database into the repository.
    If I pull the measure, period and year dimension in and filter on the year (member) and display the year (member) along with the period (alias) and measure it errors with =>
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14020] None of the fact tables are compatible with the query request Fiscal Year.Fiscal Year Code. (HY000)
    However, all other things being equal if I change the year displayed to the alias then it works.
    Anyone tell me why??
    Is there a limitation that Essbase brings through that you cannot view what you filter on?
    thanks,
    Robert.

    Hi
    i have done the content level setting in each of the table, D1,F1 and F2(LTS), now i am getting the following error..
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table Gl Sets Of Books) does not contain mapping for [Code Combinations.Code Combinations.Affiliate, GL Balances.GL Balances.Currency Code, GL Balances.GL Balances.PTD_Balance, Gl Sets Of Books.Gl Sets Of Books .SoB Name]. (HY000)
    Gl Balances : D1
    Code Commbination: F1
    Gl Sets Of Books : F2
    I have checked the joins in physical and BMM layer..all are fine..

  • Fact tables are compatible with the query request

    Hi,
    i am using 11g.In 10g working fine without any error.After migrate 10g into 11g below error will returning. What is the problem and How we will fix.Could you pls let me know.Thanks
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14020] None of the fact tables are compatible with the query request FACT_AGENT_TIME_STATISTICS.FKEY. (HY000)
    SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10 FROM ( SELECT 0 s_0, "Team Performance"."DIMENSION - LOCATION"."COUNTRY CODE" s_1, "Team Performance"."DIMENSION - TIME"."BUSINESS DATE" s_2, CASE WHEN "Team Performance"."DIMENSION - TEAM"."ROLE" ='TEAM LEADER' THEN 'Team Leader' ELSE "Team Performance"."DIMENSION - TEAM"."TEAM" END s_3, CASE WHEN '30 Mins Interval' ='15 Mins Interval' THEN "Team Performance"."DIMENSION - TIME"."15 Mins Interval" ELSE "Team Performance"."DIMENSION - TIME"."30 Mins Interval" END s_4, ((SUM("Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - ACD CALL HANDLING"+"Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - AFTER CALL WORK (ACW)")+SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."AVAILABLE TIME"))/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") s_5, (SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."AUX3 - TRAINING"+"Team Performance"."FACT - AGENT TIME STATISTICS"."AUX4 - MEETING"+"Team Performance"."FACT - AGENT TIME STATISTICS"."AUX5 - PROJECT"+"Team Performance"."FACT - AGENT TIME STATISTICS"."AUX6 - COACHING")/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") s_6, (SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."STAFFED TIME")/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") s_7, COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE" s_8, MIN("Team Performance"."DIMENSION - TIME"."FULL DATE TIME") s_9, REPORT_AGGREGATE(((SUM("Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - ACD CALL HANDLING"+"Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - AFTER CALL WORK (ACW)")+SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."AVAILABLE TIME"))/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") BY CASE WHEN '30 Mins Interval' ='15 Mins Interval' THEN "Team Performance"."DIMENSION - TIME"."15 Mins Interval" ELSE "Team Performance"."DIMENSION - TIME"."30 Mins Interval" END, CASE WHEN "Team Performance"."DIMENSION - TEAM"."ROLE" ='TEAM LEADER' THEN 'Team Leader' ELSE "Team Performance"."DIMENSION - TEAM"."TEAM" END) s_10 FROM "Team Performance" WHERE (("DIMENSION - TIME"."BUSINESS DATE" BETWEEN timestamp '2012-11-23 00:00:00' AND timestamp '2012-11-23 00:00:00') AND ("DIMENSION - LOCATION"."COUNTRY CODE" = 'US') AND ("DIMENSION - LOCATION".DEPARTMENT = 'CSG')) ) djm FETCH FIRST 65001 ROWS ONLY

    Back up your repository before following these steps:
    1 Reduce the problem report to minimum number of columns required to generate the error. This will usually identify which dimension and which fact are incompatible.
    2 Open the repository in the Administration tool and verify that the dimension and fact table join at the physical layer of the repository
    3 Verify that there is a complex join between the dimension and the fact in the business layer.
    4 Check the logical table sources for the fact table. At least one of them must have the Content tab set to a level in the hierarchy that represents the problem dimension. This is usually the detailed level.
    5 Check the logical table source Content tab for the dimension table. Unless there is a valid reason, this should be set to blank.
    6. Save any changes to the repository.

Maybe you are looking for

  • Can I use a flash drive to back up my iTunes?

    Did a search on backing up my iTunes, and only get the option of backing up to a disc (Which is what I've done over the past 3 years. I now have 6 discs accumulated). Can I use a flash drive to back up my apps, music, and videos? I only have a total

  • My bb 9380 won't turn on while the screen shows one battery sign with red cross mark ( not charging sign )

    my bb 9380 won't turn on while the screen shows one battery sign with red cross mark ( not charging sign ), i think the battery drained and switch it for charging but it will show only not charging sign . i bought this phone before 9 months, whats th

  • Help a newb with setting up Mail.app

    Im trying to set up my Mail app with my email account hosted with my shared hosting service. Ive used mail.app before...but i seem to be running into some issues. Ive used mail.app with .mac and mobileme email addresses and they functioned properly,m

  • Will the new ATI graphics card work on PowerMac G5 Quad?

    Hello, I'm having a problem with my PowerMac G5 Quad, simply the graphics card is at fault. The rest of the machine is in perfect working order. I need a new graphics card and i've searched ebay (UK) and found some products. However, I would like a n

  • Simple MDX : Associated Date Value for returned week number on Row Axis ?

    Team , I have this MDX Below : I'm trying to see if i can also have a Column which  Uniques the week Starting/Ending Date   as below , Thanks in advance for your help and time . 1 20040101  20040101  20040103    (null) 1 20040102  20040101  20040103