Confused on RIGHT OUTER JOIN

Here is a query and desired output for a weekly sales report. The problem is that if no data exists for given businessdate, the report is empty. It should show store with zeroed totals.
NOTES:
1. storenbr must be string
2. bow, eow = beginning and end of week
3. I have no say-so on the date format
with report_stores  as
(  select  501   as storeid from dual union all
    select   22   as storeid from dual union all
    select   24   as storeid from dual
, store_details as
    select   501   as storeid,   '6504'    as storenbr,  'Quincey Circle' as storename  from dual union all
    select   22   as storeid,    '2385'    as storenbr,  'Goodlet' as storename   from dual union all
    select   24   as storeid,    '4290'   as storenbr,  'Poplar' as storename   from dual
, sales_data as
    select  501 as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  100 as sales_amt, 50 as guestcount from dual union all
    select  22  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  200 as sales_amt, 50 as guestcount from dual union all
    select  24  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')   as businessdate,  300 as sales_amt, 50 as guestcount from dual  union all
    select  501 as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')   as businessdate,  400 as sales_amt, 100 as guestcount from dual union all
    select  22  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  500 as sales_amt, 100 as guestcount from dual union all
    select  24  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  600 as sales_amt, 100 as guestcount from dual 
select  storenbr
,       to_date('01/30/2011', 'MM/DD/YYYY') as EOW
,       sum(nvl(sales_amt, 0))              as sales_amount
,       sum(nvl(sales.guestcount , 0))      as guestcount
from report_stores   stores
inner join store_details details on details.storeid = stores.storeid
left outer join sales_data sales    on  sales.storeid = stores.storeid 
                                  and   sales.businessdate  between  to_date('01/24/2011',  'MM/DD/YYYY') and to_date('01/30/2011', 'MM/DD/YYYY')
group by storename,      to_date('01/30/2011', 'MM/DD/YYYY');However, when I make date dynamic by adding a dates table, I don't get output.
with report_dates as
   select to_date('01/05/2011', 'MM/DD/YYYY') as businessdate, 'Wednesday' as day_name, 2 as week_nbr,   to_date('01/03/2011', 'MM/DD/YYYY')  as bow,   to_date('01/09/2011', 'MM/DD/YYYY')  as eow from dual union all
   select to_date('01/24/2011', 'MM/DD/YYYY') as businessdate, 'Monday'    as day_name, 5 as week_nbr,   to_date('01/24/2011', 'MM/DD/YYYY')  as bow,   to_date('01/30/2011', 'MM/DD/YYYY')  as eow from dual
, report_stores  as
(  select  501   as storeid from dual union all
    select   22   as storeid from dual union all
    select   24   as storeid from dual
, store_details as
    select   501   as storeid,   '6504'    as storenbr,  'Quincey Circle' as storename  from dual union all
    select   22   as storeid,    '2385'    as storenbr,  'Goodlet' as storename   from dual union all
    select   24   as storeid,    '4290'   as storenbr,  'Poplar' as storename   from dual
, sales_data as
    select  501 as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  100 as sales_amt, 50 as guestcount from dual union all
    select  22  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  200 as sales_amt, 50 as guestcount from dual union all
    select  24  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')   as businessdate,  300 as sales_amt, 50 as guestcount from dual  union all
    select  501 as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')   as businessdate,  400 as sales_amt, 100 as guestcount from dual union all
    select  22  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  500 as sales_amt, 100 as guestcount from dual union all
    select  24  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  600 as sales_amt, 100 as guestcount from dual 
select storenbr
,       eow
,       sum(nvl(sales_amt, 0))                as sales_amount
,       sum(nvl(sales.guestcount , 0))      as guestcount
from report_stores              stores
inner join store_details        details   on details.storeid = stores.storeid
right outer join sales_data     sales     on  sales.storeid = stores.storeid 
inner join report_dates         dte       on    dte.businessdate =   to_date('01/24/2010', 'MM/DD/YYYY')
                                    --    and   sales.businessdate between   bow  and   eow
group by storenbr, eow
;What am I doing wrong? For kicks I also tried switching the JOINS like :
Select *
from sales_data sales
left outer join report_stores            stores on stores.stoeid = sales.storeid but couldn't make this work either.

Hi,
Thanks for posting the sample data in a useful form.
Don't forget to post the results you want to get from that data. Is this what you want?
STOR EOW         SALES_AMOUNT GUESTCOUNT
6504                        0          0
2385                        0          0
4290                        0          0If so, you want to inner-join sales_data and report_dates, and then outer-join that result set to report_stores.
Here's one way to do that:
SELECT    details.storenbr
,         dte.eow
,         NVL (SUM (sales.sales_amt),  0)       AS sales_amount
,         NVL (SUM (sales.guestcount), 0)       AS guestcount
FROM           report_stores   stores
INNER JOIN      store_details      details          ON     details.storeid        = stores.storeid
LEFT OUTER JOIN (     sales_data      sales
                  JOIN     report_dates    dte         ON      sales.businessdate  BETWEEN   dte.bow 
                                                       AND           dte.eow
          )                      ON       sales.storeid          = stores.storeid
GROUP BY  details.storenbr
,             dte.eow
;As in your first query, you want the every row in report_stores to appear in the output, whether it matches anything in sales+dte or not, so you want to continue saying "FROM report_stores ... *LEFT* OUTER JOIN ...".
You'll notice that I changed
SUM (NVL (x, 0)) to
NVL (SUM (x), 0). Both give the same results, but, if you have 1000 rows, the former calls NVL 1000 times, but the latter only calls NVL once, so it's more efficient.

Similar Messages

  • Choice of left or right outer join

    Hi Experts,
    I have a two tables like named as emp demo
    desc emp
    empname varchar2(50)
    empid number
    desc demo
    empname varchar2(50)
    empid number
    when i implement the below quries i'm getting the same o/p.
    queries like
    select e.ename from emp e left outer join demo d on (e.empid=d.empid);
    select e.ename from demo d right outer join emp e on (d.empid=e.empid);
    In this case which query is most prefer
    Thnks in advance
    H

    Hi,
    943338 wrote:
    Hi Experts,
    I have a two tables like named as emp demo
    desc emp
    empname varchar2(50)
    empid number
    desc demo
    empname varchar2(50)
    empid number
    when i implement the below quries i'm getting the same o/p.Right. You're getting the same error, because there is no ename column. If you change ename to empname, then you'll still get the same results, because
    x LEFT OUTER JOIN y    ON zis equivalent to
    y RIGHT OUTER JOIN x    ON zin results and performance.
    queries like
    select e.ename from emp e left outer join demo d on (e.empid=d.empid);
    select e.ename from demo d right outer join emp e on (d.empid=e.empid);
    In this case which query is most preferBoth are equally efficient.
    Since most people never use RIGHT OUTER JOIN, it might make maintenance eaiser if you don't use it, either. I would use LEFT OUTER JOIN.

  • How to use left outer joins ,right outer joins and order by clause for belo

    Hi,
    How to use left outer joins ,right outer joins and order by clause for below XML query.
    The query which is red colour returns null then its not displaying any values for columns in that tables. Tried decode, nvl function hasn't worked.
    SELECT XMLAGG ( XMLELEMENT( "P", XMLFOREST( P.process_id AS Ppid,
              (SELECT XMLAGG( XMLELEMENT( "PI", XMLFOREST( PI.question_id AS PIqid,
                                       PI.process_id AS PIpid,
    PI.innertext AS
                                       PItext, PI.itemtype AS PItype,
                                       PI.linkfrom AS PIfrom,
                                       PI.linkto AS PIto,
    PI.associated AS PIas,
                                       PI.content_id AS PIc,
                                       PI.exitpoint1_id AS PIe1,
                                       PI.exitpoint2_id AS PIe2,
                                       PI.exitpoint3_id AS PIe3,
                                       PI.followoncall AS PIfoc,
    PI.userinput AS PIui,
                                       PI.resolveidentifier AS PIri,
    PI.libquestion_idfk AS PIlqid,
                                       PI.isLocked AS PIstls,
                                       PI.PreviousAnswer AS PIPAns,
                                       PI.VisibleToAgent AS PIVAgent,
                                       PI.RetryAttempt AS PIRetry,
                                       PI.Tags AS PITag,
                                  SELECT XMLAGG( XMLELEMENT( "PO", XMLFOREST( PO.option_id AS POoid,
                                       PO.question_id AS POqid,
                                                           PO.process_id AS popid,
                                                           PO.opt_innertext AS POtext,
                                                           PO.opt_linkfrom AS POfrom,
                                                           PO.opt_linkto AS POto,
                                                           PO.libquestion_idfk AS POlqid,
                                                           PO.liboption_idfk AS POloid ) ) )
                                  FROM vw_liveProcessOption_Sim_v6 PO
                                       WHERE PI.question_id = PO.question_id (+)
                                  AND PI.process_id = PO.process_id (+)
                                  ) "A" ) ) ) AS "PO"
         FROM vw_liveProcessItem_Sim_v6 PI
              WHERE P.process_id = PI.process_id
              ) "A" ) ) ) AS "PI"
    FROM liveProcess_ec P
    WHERE (P.process_id = 450)
    Any help really appreciated.
    Thanks

    user512743 wrote:
    Hi,
    Here below is the scripts of tables, insert statements and Required output.
    CREATE TABLE VW_LIVEPROCESSOPTION_SIM_v6
    (     "OPTION_ID" NUMBER,
         "QUESTION_ID" NUMBER(10,0),
         "PROCESS_ID" NUMBER(10,0),
         "OPT_INNERTEXT" VARCHAR2(200 CHAR),
         "OPT_LINKFROM" VARCHAR2(20 CHAR),
         "OPT_LINKTO" VARCHAR2(20 CHAR),
         "LIBQUESTION_IDFK" NUMBER,
         "LIBOPTION_IDFK" NUMBER
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,2,450,'Yes',null,'5',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,3,450,'Yes',null,'5',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,5,450,'Yes',null,'6',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,6,450,'Yes',null,'7',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,8,450,'Block All',null,'9',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,9,450,'Yes',null,'10',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,11,450,'Yes',null,'12',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,12,450,'Yes',null,'13',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,14,450,'Yes',null,'16',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,2,450,'No',null,'3',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,3,450,'No',null,'4',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,5,450,'No',null,'8',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,6,450,'No',null,'8',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,8,450,'Standard',null,'11',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,9,450,'No',null,'11',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,11,450,'No',null,'14',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,12,450,'No',null,'14',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,14,450,'No',null,'15',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (3,8,450,'Disabled',null,'12',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (4,8,450,'User Defined',null,'12',null,null);
    REATE TABLE "VW_LIVEPROCESSITEM_SIM_v6"
    (     "QUESTION_ID" NUMBER(10,0),
         "PROCESS_ID" NUMBER(10,0),
         "INNERTEXT" VARCHAR2(200 CHAR),
         "ITEMTYPE" VARCHAR2(50 CHAR),
         "LINKFROM" VARCHAR2(500 CHAR),
         "LINKTO" VARCHAR2(500 CHAR),
         "ASSOCIATED" VARCHAR2(200 CHAR),
         "CONTENT_ID" NUMBER,
         "EXITPOINT1_ID" NUMBER(10,0),
         "EXITPOINT2_ID" NUMBER(10,0),
         "EXITPOINT3_ID" NUMBER(10,0),
         "RESOLVEIDENTIFIER" VARCHAR2(40 CHAR),
         "LIBQUESTION_IDFK" NUMBER(10,0),
         "FOLLOWONCALL" NUMBER(1,0),
         "USERINPUT" VARCHAR2(200 CHAR),
         "ISLOCKED" NUMBER(1,0),
         "PREVIOUSANSWER" NUMBER(1,0),
         "VISIBLETOAGENT" NUMBER(1,0),
         "RETRYATTEMPT" NUMBER(10,0),
         "TAGS" VARCHAR2(50 BYTE)
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (1,450,'CBB1015 - Router Firewall Settinngs Process','Title',null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (2,450,'Is the customers PC Firewall turned off?','Question','1','2.2,2.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (3,450,'Advise the customer to turn off the PC Firewall in order to continue. Has this been done?','Question','2.2','3.2,3.1',null,278,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (4,450,'Advise the customer the PC Firewall must be switched off before this process????','ExitPoint','3.2',null,null,null,14,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (5,450,'Is the customer able to access the internet now?','Question','3.1,2.1','5.2,5.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (6,450,'Is the customer having a problem with a specific website?','Question','5.1','6.2,6.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (7,450,'1536: CBB1008 - Browser Setup and Daignostics','SubProcess','6.1',null,'1536-1-0',null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (8,450,'What is the security level on the CPE Management page?','Question','6.2,5.2','8.4,8.3,8.2,8.1',null,279,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (9,450,'Change the security level to Standard. Does this resolve the customers issue?','Question','8.1','9.2,9.1',null,280,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (10,450,'Issue Resolved','ExitPoint','9.1',null,null,null,1,6,122,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (11,450,'Change the security level to Disabled. Is the customer able to browse the internet?','Question','9.2,8.2','11.2,11.1',null,281,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (12,450,'Change the security level to Standard. Is the customer able to browse the internet now?','Question','11.1,8.3,8.4','12.2,12.1',null,283,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (13,450,'Issue Resolved','ExitPoint','12.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (14,450,'Ask the customer to perform a master reset. Does this resolve their issue?','Question','12.2,11.2','14.2,14.1',null,282,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (15,450,'Faulty CPE','ExitPoint','14.2',null,null,null,1,6,124,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (16,450,'Issue Resolved','ExitPoint','14.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
    CREATE TABLE "LIVEPROCESS_EC_V"
    (     "PROCESS_ID" NUMBER(10,0),
         "USER_ID" NUMBER(10,0),
         "CREATED" TIMESTAMP (6)
    Insert into LIVEPROCESS_EC (PROCESS_ID,USER_ID,CREATED) values (450,7460,to_timestamp('21-APR-08 09.34.41.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Required O/P in XML format
    <P>
    <Ppid>450</Ppid>
    <PI>
    <PIqid>1</PIqid>
    <PIpid>450</PIpid>
    <PItext>CBB1015 - Router Firewall Settinngs Process</PItext>
    <PItype>Title</PItype>
    <PIto>2</PIto>
    <PO />
    </PI>
    <PI>
    <PIqid>2</PIqid>
    <PIpid>450</PIpid>
    <PItext>Is the customers PC Firewall turned off?</PItext>
    <PItype>Question</PItype>
    <PIfrom>1</PIfrom>
    <PIto>2.2,2.1</PIto>
    <PO>
    <POoid>1</POoid>
    <POqid>2</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>5</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>2</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>3</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>3</PIqid>
    <PIpid>450</PIpid>
    <PItext>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PItext>
    <PItype>Question</PItype>
    <PIfrom>2.2</PIfrom>
    <PIto>3.2,3.1</PIto>
    <PIc>278</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>3</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>5</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>3</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>4</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>4</PIqid>
    <PIpid>450</PIpid>
    <PItext>Advise the customer the PC Firewall must be switched off before this process????</PItext>
    <PItype>ExitPoint</PItype>
    <PIfrom>3.2</PIfrom>
    <PIe1>14</PIe1>
    <PO />
    </PI>
    <PI>
    <PIqid>5</PIqid>
    <PIpid>450</PIpid>
    <PItext>Is the customer able to access the internet now?</PItext>
    <PItype>Question</PItype>
    <PIfrom>3.1,2.1</PIfrom>
    <PIto>5.2,5.1</PIto>
    <PO>
    <POoid>1</POoid>
    <POqid>5</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>6</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>5</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>8</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>6</PIqid>
    <PIpid>450</PIpid>
    <PItext>Is the customer having a problem with a specific website?</PItext>
    <PItype>Question</PItype>
    <PIfrom>5.1</PIfrom>
    <PIto>6.2,6.1</PIto>
    <PO>
    <POoid>1</POoid>
    <POqid>6</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>7</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>6</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>8</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>7</PIqid>
    <PIpid>450</PIpid>
    <PItext>1536: CBB1008 - Browser Setup and Daignostics</PItext>
    <PItype>SubProcess</PItype>
    <PIfrom>6.1</PIfrom>
    <PIas>1536-1-0</PIas>
    <PO />
    </PI>
    <PI>
    <PIqid>8</PIqid>
    <PIpid>450</PIpid>
    <PItext>What is the security level on the CPE Management page?</PItext>
    <PItype>Question</PItype>
    <PIfrom>6.2,5.2</PIfrom>
    <PIto>8.4,8.3,8.2,8.1</PIto>
    <PIc>279</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>8</POqid>
    <popid>450</popid>
    <POtext>Block All</POtext>
    <POto>9</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>8</POqid>
    <popid>450</popid>
    <POtext>Standard</POtext>
    <POto>11</POto>
    </PO>
    <PO>
    <POoid>3</POoid>
    <POqid>8</POqid>
    <popid>450</popid>
    <POtext>Disabled</POtext>
    <POto>12</POto>
    </PO>
    <PO>
    <POoid>4</POoid>
    <POqid>8</POqid>
    <popid>450</popid>
    <POtext>User Defined</POtext>
    <POto>12</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>9</PIqid>
    <PIpid>450</PIpid>
    <PItext>Change the security level to Standard. Does this resolve the customers issue?</PItext>
    <PItype>Question</PItype>
    <PIfrom>8.1</PIfrom>
    <PIto>9.2,9.1</PIto>
    <PIc>280</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>9</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>10</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>9</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>11</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>10</PIqid>
    <PIpid>450</PIpid>
    <PItext>Issue Resolved</PItext>
    <PItype>ExitPoint</PItype>
    <PIfrom>9.1</PIfrom>
    <PIe1>1</PIe1>
    <PIe2>6</PIe2>
    <PIe3>122</PIe3>
    <PO />
    </PI>
    <PI>
    <PIqid>11</PIqid>
    <PIpid>450</PIpid>
    <PItext>Change the security level to Disabled. Is the customer able to browse the internet?</PItext>
    <PItype>Question</PItype>
    <PIfrom>9.2,8.2</PIfrom>
    <PIto>11.2,11.1</PIto>
    <PIc>281</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>11</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>12</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>11</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>14</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>12</PIqid>
    <PIpid>450</PIpid>
    <PItext>Change the security level to Standard. Is the customer able to browse the internet now?</PItext>
    <PItype>Question</PItype>
    <PIfrom>11.1,8.3,8.4</PIfrom>
    <PIto>12.2,12.1</PIto>
    <PIc>283</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>12</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>13</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>12</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>14</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>13</PIqid>
    <PIpid>450</PIpid>
    <PItext>Issue Resolved</PItext>
    <PItype>ExitPoint</PItype>
    <PIfrom>12.1</PIfrom>
    <PIe1>1</PIe1>
    <PIe2>6</PIe2>
    <PIe3>123</PIe3>
    <PO />
    </PI>
    <PI>
    <PIqid>14</PIqid>
    <PIpid>450</PIpid>
    <PItext>Ask the customer to perform a master reset. Does this resolve their issue?</PItext>
    <PItype>Question</PItype>
    <PIfrom>12.2,11.2</PIfrom>
    <PIto>14.2,14.1</PIto>
    <PIc>282</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>14</POqid>
    <popid>450</popid>
    <POtext>Yes</POtext>
    <POto>16</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>14</POqid>
    <popid>450</popid>
    <POtext>No</POtext>
    <POto>15</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>15</PIqid>
    <PIpid>450</PIpid>
    <PItext>Faulty CPE</PItext>
    <PItype>ExitPoint</PItype>
    <PIfrom>14.2</PIfrom>
    <PIe1>1</PIe1>
    <PIe2>6</PIe2>
    <PIe3>124</PIe3>
    <PO />
    </PI>
    <PI>
    <PIqid>16</PIqid>
    <PIpid>450</PIpid>
    <PItext>Issue Resolved</PItext>
    <PItype>ExitPoint</PItype>
    <PIfrom>14.1</PIfrom>
    <PIe1>1</PIe1>
    <PIe2>6</PIe2>
    <PIe3>123</PIe3>
    <PO />
    </PI>
    </P>
    Thanks in advance
    Edited by: user512743 on Nov 18, 2008 4:46 AM

  • Right Outer Join in OWB

    Hi,
    I am trying to do a right outer join between 2 tables say a and b, and I specify the following condition in the joiner as follows, say
    a.deptno(+) = b.deptono. But it throws an error during deployment as follows
    PL/SQL: ORA-25156: old style outer join (+) cannot be used with ANSI joins.
    I am using OWB Release 10.2(Paris)
    Your help would be appreciated.
    regards,
    varsha

    Hi
    Check the generated code from the mapping, or the internediate result in the mappings output group.
    Maybe you should use new oter join definitions:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#sthref3175
    Ott Karesz
    http://www.trendo-kft.hu

  • Unable to make a Right-Outer Join

    Unable to implement the following Query in the WebI Report.
    In Universe, I have all the 4 views and made the complex right outer join with the constraints from the query. However, i cannot have all the columns in the select clause in WebI Report as i can see queries are breaked up into 4 queries under synchronization folder. And unable to implement the custom query.
    Note : There are no primary keys / column to identify unique row. However, combination of columns helps to identify the unique row which is used in join conditions.
    How get a report based on the following query
    SELECT aht."RESOURCE NAME",
        aht.week,
        aht.resource_key,
        aht."WEEK END DATE",
        Round(aht.aht,2),
        Round(aht.att,2),
        tnr."TNR%",
        nr.nr_reason_time,
        vw."Complaince",
        vw."Rapport_Score",
        vw."Solution_Score",
        vw."Value_Score",
        aht.group_combination_key
      FROM (select * from GIM_AHT_ATT where WEEK in ( SELECT DISTINCT LABEL_YYYY_WE FROM DATE_TIME WHERE CAL_DATE BETWEEN (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-34) AND (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-7) ) and RESOURCE_KEY in (Select resource_key from resource_ where resource_type_code ='AGENT' and resource_name in @Prompt('Agent:','A','Activity\User Name',MULTI,CONSTRAINED,Persistent,{'ALL'},user:10))) aht
      LEFT OUTER JOIN (Select * from Verint_wfm where Verint_wfm."Week_NUM" in ( SELECT DISTINCT LABEL_YYYY_WE FROM DATE_TIME WHERE CAL_DATE BETWEEN (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-34) AND (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-7) ) and
      Verint_wfm."Resource_Key" in (Select resource_key from resource_ where resource_type_code ='AGENT' and resource_name in @Prompt('Agent:','A','Activity\User Name',MULTI,CONSTRAINED,Persistent,{'ALL'},user:10))) vw
      ON (aht.week         = vw."Week_NUM"
      AND aht.resource_key = vw."Resource_Key" )
      LEFT OUTER JOIN (Select * from GIM_TNR where GIM_TNR.WEEK in ( SELECT DISTINCT LABEL_YYYY_WE FROM DATE_TIME WHERE CAL_DATE BETWEEN (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-34) AND (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-7) )  and GIM_TNR.RESOURCE_KEY in (Select resource_key from resource_ where resource_type_code ='AGENT' and resource_name in @Prompt('Agent:','A','Activity\User Name',MULTI,CONSTRAINED,Persistent,{'ALL'},user:10))) tnr
      ON (aht.week                    = tnr.week
      AND aht.resource_key            = tnr.resource_key
      AND aht.group_combination_key = tnr."Group Combination Key"  )
      LEFT OUTER JOIN (Select * from GIM_NR_REASON where GIM_NR_REASON.LABEL_YYYY_WE in ( SELECT DISTINCT LABEL_YYYY_WE FROM DATE_TIME WHERE CAL_DATE BETWEEN (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-34) AND (next_day(To_Date(@Prompt('Date:','D',,Mono,Free,Persistent,{'1/1/2011 12:00:00 AM'},User:2),'DD-MM-YYYY HH24:MI:SS'),'Saturday')-7) ) and GIM_NR_REASON.RESOURCE_KEY in (Select resource_key from resource_ where resource_type_code ='AGENT' and resource_name in @Prompt('Agent:','A','Activity\User Name',MULTI,CONSTRAINED,Persistent,{'ALL'},user:10))) nr
      ON(aht.week                    = nr.label_yyyy_we
      AND aht.resource_key           = nr.resource_key
      AND aht.group_combination_key = nr."Group Combination Key" );

    In Unvierse Designer under File>Paramters>SQL Tab, all "Mutiple Path" options are unchecked?
    Regards,
    Bilahari M

  • Could any one tell me how to do the left outer join or right outer join?

    Could any one  tell me how to do the left outer join or right outer join in Webi Rich Client? thanks.

    we can do it in two ways
    1.  In  web intelligence level  on the query panel click the sql query and write the statement what ever u want there by modifying the existing statement.
    2.  In universe level select the fields in the two tables that you want to make join and create the join between two tables directly by joining field in table 1 to the field in the table 2 by drawing a line and double click on the line to view the join properties,then on join properties if we check the table 1 outer then it is left outer join if we check on table 2 outer then it will be the right outer join.after exporting the universe to the central sever we are now ready to use in web intelligence with out being changed anything in the sql query.
    endorse me if it is useful.
    thanks & regards
    Sreekanth.

  • RIGHT OUTER JOIN

    I would like to know how i can rewrite this statement below in ANSI-92 standard:
    SELECT A.COMMON_COL1, B.COMMON.COL2 FROM
    TABLE_A.COMMON_COL1 A,
    TABLE_B.COMMON_COL2 B
    WHERE TABLE_A.COMMON_COL1(+) = TABLE_B.COMMON_COL2;Many Thanks.

    FROM table_a a JOIN table_b b ON a.fk=b.pk
    or
    FROM (SELECT fk, other_col FROM table_a) a
    JOIN (SELECT pk, other_other_col FROM table_b) b ON a.fk = b.pk

  • Join-types right & full outer join with Datasets

    Hello
    I use Crystal Reports XI Release 2 with ADO.NET Datasets as datasource. In the "Database-Expert" I try to set the "Link-Options". Unfortunately are the join-types "right outer join" and "full outer join" disabled.
    - Is this because of the datasource Dataset?
    - Is there e possibility to build the Dataset so I can use this two joins?
    - If not, is it possible in a newer version?
    Thanks, T.Fitzi

    Hi
    I think this is the problem. I don't connect directly to a database. My application (C#) provieds Crystal Report with a dataset. So all my data is in this dataset.
    Are this joins in the new version stil disabled?
    Regards, Thomas

  • What is left join /right join / out join/ inner join/please give example!

    what is left join /right join / out join/ inner join/please give example!
    thanks

    Maybe these examples will give you an idea...
    SQL> select * from t1;
            ID
             1
             2
             3
             4
    SQL> select * from t2;
            ID
             3
             4
             5
             6
    -- LEFT OUTER JOIN
    SQL> select t1.id, t2.id
      2  from t1 LEFT OUTER JOIN t2 ON (t1.id = t2.id);
            ID         ID
             3          3
             4          4
             1
             2
    -- RIGHT OUTER JOIN
    SQL> select t1.id, t2.id
      2  from t1 RIGHT OUTER JOIN t2 ON (t1.id = t2.id);
            ID         ID
             3          3
             4          4
                        6
                        5
    -- LEFT JOIN (SAME AS LEFT OUTER JOIN)
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 LEFT JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
             1
             2
    -- RIGHT JOIN (SAME AS RIGHT OUTER JOIN)
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 RIGHT JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
                        6
                        5
    -- INNER JOIN (REGULAR JOIN)
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 INNER JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
    -- FULL OUTER JOIN
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 FULL OUTER JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
             1
             2
                        6
                        5
    6 rows selected.
    SQL>

  • Dealing with Inner/Outer Joins

    Hi,
    We would create a BO universe and deploy it so that the users can create ad-hoc reports from the universe.
    The issue here is how do we define the joins in the universe. I have explained in the below e.g.:
    Assume, there are 2 tables: BIN and INVENTORY. Here are the sample contents of these tables:
    BIN Contents
    BIN_NUM BIN_NAME
    1 Bin1
    2 Bin2
    3 Bin3
    INVENTORY Contents
    ITEM_ID BIN_NUM
    a 1
    b 1
    c
    d 3
    Possible Reports:
    We can imagine that end users may want to produce the following reports.
    1) List bins and the items they contain
    BIN_NAME     ITEM_ID
    Bin1          a
    Bin1          b
    Bin3          d
    2) List bins and the items they contain.  Display null as ITEM_ID for every bin that does not contain an item
    BIN_NAME     ITEM_ID
    Bin1          a
    Bin1          b
    Bin2          Null
    Bin3          d
    3) List items and the bin each is in.  Display null for bin if an item is not in a bin
    BIN_NAME           ITEM_ID
    Bin1             a
    Bin1             b
    Null             c
    Bin3             d
    4) List all bins and items.  If a bin is empty, display null for item; if an item is not in a bin, display null for bin
    BIN_NAME            ITEM_ID
    Bin1                a
    Bin1                b
    Bin2                Null
    Null                c
    Bin3                d
    These reports are produced using inner join, right outer join, left outer join and full outer join respectively.
    Questions
    If users of the ad-hoc reporting tool may want to produce any one of these reports at any time then:
    1) What do we specify in the universe.
    2) What will end-users see and how do they differentiate between the different types of report.
    Please note that the users are very very basic users and they are very new to the tool. (They will not know how to modify SQL or add a filter etc.). All that they would do is just drag and drop. I also thought of aliasing the Inventory table, but that would again involve lot of confusion cos there are many such tables that would fall in this category. Creation of alias tables would again make things complicated, having multiple objects and chances that the user might pull both these objects while creating the report.
    Please let me know if any of you have found some solution for this scenario and what is the best possible option to implement.
    Thanks,
    Meghana

    Meghana,
    Here are some general comments to consider when you are building a universe using Designer:
    - users will "see" only what you present to them (they will not see raw table names or column names, you are creating the "human" interface)
    - a certain amount of training is going to have to take place before you "let them loose", either training via a PowerPoint presentation or hands-on computer lab, but key information that you the designer of the universe know that the user must know is what needs to be passed along, regardless of the application
    With all that said, and what you've said in your posting about join considerations, etc, etc, you are on the right track.  So, if you have a requirement to report on equi join, right outer, or left outer join, you need to determine if you must build a separate universe for each or you can co-mingle, but teach users how to apply only one concept in a report at a given time (the join type is mutually exclusive, so somehow you need to convey that).  As far as actual objects, you'll have to be straightforward, for instance an object "bin and inventory", or "bin and no inventory match", or "inventory and no bin match" and then you build each object in Designer specifying the join type (ensure you have ANSI92 enabled).  The user never needs to know that it is an equi join, or outer join, you are insulating everyone from that and merely providing the objects that will be assembled to put the data on the screen when the user is done building the report.  I know this is pretty abstract stuff I'm mentioning, but you'll have to gain a very good understanding of universe building, experiment, and test with a select few users before moving forward.  Good luck.
    John
    Edited by: John Sanzone on Jun 6, 2008 9:58 PM

  • How can we make an outer join (+) between 2 Queries

    in the data model, i have 2 queries
    i.e
    Q_master and Q_detail
    i want to make a data link between
    these two queries and
    also make an outer join between these
    two queries(i.e. to display all the detail
    records, whether they have details or not)
    please reply is it possible ?
    if yes then how?
    plz write.
    [email protected]
    null

    Hello,
    Left outer join behavior is what you get by default with a link between two queries in Reports.
    If you want a full outer join behavior, you'll need to create a third query that selects the detail records that have no corresponding master, and also create an extra layout region to display them in as a default group left or group above won't pick up these extra records.
    If you want right outer join behavior, you'll need to put in a summary in the master query that counts the rows in the detail, and then put in a format trigger in the master repeating frame that suppresses printing when there are no detail records. And you'll also need the third query and layout section as in the full outer join case.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Non-ANSI Outer Join Operator Issue (reposted due to text issues)

    I am currently using Designer 11.5.0.0. Itu2019s XI Rel 2, but Iu2019m not sure what service pack. I have created several universes with outer joins against a SQL Server 2005 database, but when I try using them in a Crystal report, I get the following error:
    Failed to retrieve date from the database. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server] The query uses non-ANSI outer join operators (u201C=u201D or u201C=u201D). To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes.
    Here is my ODBC DSN configuration:
    Microsoft SQL Server ODBC Driver Version 03.85.1132
    Data Source Name: FlexOPS
    Data Source Description:
    Server: dalsvrw031
    Database: (Default)
    Language: (Default)
    Translate Character
    Data: Yes
    Log Long Running Queries: No
    Log Driver Statistics: No
    Use Integrated Security: No
    Use Regional Settings: No
    Prepared Statements Option: Drop temporary procedures on disconnect
    Use Failover Server: No
    Use ANSI Quoted Identifiers: Yes
    Use ANSI Null, Paddings and Warnings: Yes
    Data Encryption: No
    Okay, so I understand what the issue is. It appears that the version of Designer that I am using does not default the ANSI92 parameter to u201CYesu201D. So all the outer joins I have created in each of my universe are using the old *= as the join operator. And apparently, the ODBC driver I am using is not very happy with that.
    As I understand it from what Iu2019ve read on other sites, I have the following options:
    1) Set the ANSI92 parameter to Yes, drop all my joins, close and re-open Designer, and recreate all of the joins.
    2) Find a different driver or connectivity method that will support non-ANSI joins.
    3) Set my database back to SQL 2000 compatibility.
    Option 1 is unappealing as it will cause a lot of time redoing all the work that Iu2019ve spent the past month doing. Option 2 is only a band-aid fix at best. Option 3 really isnu2019t an option for us.

    So I am wondering what other options I have to change these non-ANSI joins to ANSI compatible joins. Do I need to update Designer with a service pack? Is there a script out there that will automatically do this in each of the universes? I would appreciate any suggestions or guidance on this.
    Thanks,
    Lee

  • Non-ANSI Outer Join Operator Issue

    I am currently using Designer 11.5.0.0.  Itu2019s XI Rel 2, but Iu2019m not sure what service pack.  I have created several universes with outer joins against a SQL Server 2005 database, but when I try using them in a Crystal report, I get the following error:
    Failed to retrieve date from the database.
    Details:  42000:[Microsoft][ODBC SQL Server Driver][SQL Server] The query uses non-ANSI outer join operators (u201C=u201D or u201C=u201D).  To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel.  It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN).  In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes.
    Here is my ODBC DSN configuration:
    Microsoft SQL Server ODBC Driver Version 03.85.1132
    Data Source Name: FlexOPS
    Data Source Description:
    Server: dalsvrw031
    Database: (Default)
    Language: (Default)
    Translate Character Data: Yes
    Log Long Running Queries: No
    Log Driver Statistics: No
    Use Integrated Security: No
    Use Regional Settings: No
    Prepared Statements Option: Drop temporary procedures on disconnect
    Use Failover Server: No
    Use ANSI Quoted Identifiers: Yes
    Use ANSI Null, Paddings and Warnings: Yes
    Data Encryption: No
    Okay, so I understand what the issue is.  It appears that the version of Designer that I am using does not default the ANSI92 parameter to u201CYesu201D.  So all the outer joins I have created in each of my universe are using the old *= as the join operator.  And apparently, the ODBC driver I am using is not very happy with that.
    As I understand it from what Iu2019ve read on other sites, I have the following options:
    1)   Set the ANSI92 parameter to Yes, drop all my joins, close and re-open Designer, and recreate all of the joins.
    2)   Find a different driver or connectivity method that will support non-ANSI joins.
    3)   Set my database back to SQL 2000 compatibility.
    Option 1 is unappealing as it will cause a lot of time redoing all the work that Iu2019ve spent the past month doing.  Option 2 is only a band-aid fix at best.  Option 3 really isnu2019t an option for us.
    So I am wondering what other options I have to change these non-ANSI joins to ANSI compatible joins.  Do I need to update Designer with a service pack?  Is there a script out there that will automatically do this in each of the universes?
    I would appreciate any suggestions or guidance on this.
    Thanks,
    Lee
    Edited by: Lee Vance on Jul 6, 2009 10:02 PM

    Hi,
    try the following:
    open your universe in the Universe designer, go to File->Parameter, select the Parameter tab and change the value of the ANSI92 parameter from No to Yes.
    Regards,
    Stratos

  • Oracle OUTER JOIN on more than one table

    Hi!
    Friends, please help with this urgent problem: How can an outer join be written on more than one table?
    An SQL Server query:
    SELECT * from a INNER JOIN b on a.id = b.id LEFT OUTER JOIN c ON c.id = a.id AND c.id = b.id
    works fine with SQL SERVER
    But Oracle query:
    SELECT * from a,b,c WHERE a.id = b.id AND a.id = c.id (+) AND b.id = c.id (+)
    gives an error: OUTER JOIN cannot be used on more than one table? Why?
    I use OracleDriver from classes12.zip to connect to Oracle8i database.
    Please, help!

    The Oracle 8i and later SQL reference reads that the following "join_types" are supported and under this syntax it does not limit the LEFT OUTER JOIN (syntax the same as SQLServer example in original note) to two tables as implied in these notes:
    The join_type indicates the kind of join being performed:
    Specify INNER to indicate explicitly that an inner join is being performed. This is the default.
    Specify RIGHT to indicate a right outer join.
    Specify LEFT to indicate a left outer join.
    Specify FULL to indicate a full or two-sided outer join. In addition to the inner join, rows from both tables that have not been returned in the result of the inner join will be preserved and extended with nulls.
    You can specify the optional OUTER keyword following RIGHT, LEFT, or FULL to explicitly clarify that an outer join is being performed.

  • Best Practice - Outer Join between Fact and Dim table

    Hi Gurus,
    Need some advice on the below scenario
    I have an OOTB subject area and we have around 50-60 reports based on it. The related subject area Fact and Dim1 table are having inner join.
    Now I have a scenario for one report where outer join has to be implemented between Fact and Dim1. Here I am against changing the OOTB subject area join as the outer join will impact the performance of other 50-60 reports.
    Can anyone provide any inputs on what is the best way to handle this scenario?
    Thanks

    Ok. I tried this:
    Driving table : Fact, Left outer join -- didnt work.
    Driving table: Dimension D left outer join -- didnt work either
    In either the case, I see physical query as D left outer Join on Fact F. and omitting the rows.
    And then I tried this -
    Driving table: Fact, RIght outer join.
    Now, this is giving me error:
    Sybase][ODBC Driver]Internal Error. [nQSError: 16001] ODBC error state: 00000 code: 30128 message: [Sybase][ODBC Driver]Data overflow. Increase specified column size or buffer size. [nQSError: 16011] ODBC error occurred while executing SQLExtendedFetch to retrieve the results of a SQL statement. (HY000)
    I checked all columns, everything matched with database table type and size.
    I am pulling Fact.account number, Dimension.account name, Fact.Measures. I am seeing this error each time I pull Fact.Account number.

Maybe you are looking for

  • Thumbnails missing in new tab

    they don't show anymore. how do i restore this function

  • Fusion Middleware 11g (Forms) Application setup

    Hi, This is a requirement in Weblogic server set up for a Fusion Middleware 11g (Forms) Application I have 2 requirements: If there is a url say https://abc.world.corp/ 1. I wanted to restrict the user from accessing https://abc.world.corp/admin (thi

  • Automatic Display of NEW Data in ALV Report using Classes and Methods

    Hi, I have developed a ALV Report for displaying data from a set of DB tables using ABAP OO, Classes and Methods. The requirement is to have the report output to be automatically updated with the new entries from the DB table at a regular frequency o

  • Phonegap plugins not work with edge animate CC 2014

    I have been using edge animate to create mobile apps with phonegap and until now everything was ok. Now I updated edge (edge animate CC 2014.1 release) and when I build in phonegap, the plugins (e.g Dialogs) does not work. Is there incompatibility be

  • PSE9 quits when saving

    I've deleted the preferences, restarted my computer, and it still quits when I'm saving.  Please help, I'm in the middle of a project and need to finish.  Thanks for any help.