How to write an outer join

Hi,
Let's suppose I have to write an outer join like this:
select ...
from table_1 a, table_2 b
where a.field1 = b.field1
and a.field2 >= b.field2
but I know that for some values there might not to be a matching between the two tables.
Should I rewtire a query as follows?
select ...
from table_1 a, table_2 b
where a.field1 *(+) =* b.field1
and a.field2 *(+) >=* b.field2
I mean, should I put the (+) in both of matches?
Thanks!

Please consider the following when you post a question.
1. New features keep coming in every oracle version so please provide your Oracle DB Version to get the best possible answer.
You can use the following query and do a copy past of the output.
select * from v$version 2. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
I have the following table called sales
with sales
as
      select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
      union all
      select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
select *
  from sales 3. Rather than telling what you want in words its more easier when you give your expected output.
For example in the above sales table, I want to know the total quantity and number of invoice for each product.
The output should look like this
Prod_id   sum_qty   count_inv
1         145       2 4. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
5. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
use the {noformat}{noformat} tags.
The usage of the tag is like this.
<place your code here>\
6. If you are posting a performance related question. Please read
   {thread:id=501834} and {thread:id=863295}.
   Following those guide will be very helpful.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • 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

  • How to do left outer join in one-one mapping

    I tried to do a left outer join between two tables. I specified
    kodo.jdbc.DBDictionary: JoinSyntax=sql92 in kodo.properties. I used
    ref-join-type="outer" in the package.mapping. However, I still see Kodo is
    translating my queries using inner join. How can I force kodo to use outer
    join (or maybe even to use left outer join) when translating my queries?
    Thanks.

    Kodo will automatically use an outer join when eager-fetching a to-one
    relation (unless you have set null-value="exception" on the field, in
    which case Kodo knows it can use an inner join). There is no need to set
    the ref-join type (in fact, that is only for when the foreign key
    columns are in a joined table).
    When you place criteria on a relation in a query, though, the relation
    must exist to satisfy the query. For example, in the filter:
    "relation.x == y"
    The "relation" field must hold a related object to satisfy the
    expression, just as in Java.
    If you want the "relation" field to optionally be null, then write your
    filter exactly as you would in Java:
    "relation == null || relation.x == y"
    Kodo will correctly use an outer join in this case because the filter
    can be satisfied even when no related object exists.

  • How to use left outer join on more than one table (source)

    Hi all,
    In our project we are converting the Unix shell & SQL scripts into OWB mappings. We are facing problem converting left outer join in OWB. here is one of the example. i have just pasted the FROM and where condition.
    FROM ym_scr t1, branch_finmonth t3
    LEFT OUTER JOIN item_image t2
    ON (t1.branch_no = t2.branch_no
    AND t1.item_no = t2.item_no
    AND t3.to_date between t2.tran_dt and t2.to_dt
    AND t2.to_dt >= '$start_images' ) <<<========= '$start_images' THIS COMES FROM THE UNIX VARAIBLE ,
    We converts the same when we are putting it in OWB join Operator
    INGRP1.branch_no = INGRP2.branch_no(+)
    AND INGRP1.item_no = INGRP2.item_no(+)
    AND INGRP3.to_date between t2.tran_dt and t2.to_dt
    AND INGRP2.to_dt >= INGRP2.start_images
    But as you see in the OWB opreator we can put left join with INGRP1 with INGRP2.
    We can not make same join with INGRP3 & INGRP4 , becoz it failed saying "you cannot left outer join on more than one table/source".
    so overall this OWB code makes incomplete left outer join as per the above ANSI SQL join in Oracle.
    Bcoz of the problem we are getting less number of rows...........
    SO please please help me on this
    Regards
    Ashok

    Hi.
    I know this topic is here for a while now, but I had the same problem today, searched for help and didn´t find anything.
    Later I figured out how to do this.
    You just have to put the (+) one time, and the OWB converts in an LEFT OUTER JOIN statement.
    For this case, all you have to do is:
    ( INGRP1.branch_no = INGRP2.branch_no(+) AND INGRP1.item_no = INGRP2.item_no AND INGRP2.to_dt >= INGRP2.start_images )
    Regards,
    Godoy

  • How to achieve an outer join with existsNode() function

    I have a requirement to do an outer join with existsNode() function in my where clause. At present my where clause for join is like below
    WHERE A.SOME_ID= “XYZ”
    AND existsNode (B.SOMEXML_FEILD , …. ) = 1
    AND existsNode (C.SOMEOTHERXML_FEILD , …. ) = 1
    In this case if the existsNode fails on B or C, I still want data from A to be selected. How to rewrite this query to achieve that? I kinda want to achieve an outer join

    Hi,
    is this what you are looking for:
    SQL> with t as(select 1 id1,'A' name from dual union all
      2            select 2 ,'B' name from dual union all
      3            select 3,'C' from dual)
      4      ,x as(select 1 id2,xmltype('<a>a</a>') xcol from dual union all
      5            select 2 ,xmltype('<b>b</b>') xcol from dual)
      6  select *
      7  from t,x
      8  where t.id1=x.id2(+)
      9    and (existsNode(x.xcol,'/a')=1 or x.xcol is null);
           ID1 N        ID2 XCOL                                                   
             1 A          1 <a>a</a>                                               
             3 C                                                                   
    SQL> spool off;

  • How do I use OUTER JOIN to email different message than the default

    I have a devotional that goes out daily from a MOBILE table containing:
    mob_id
    calendardate
    title
    scripture
    body
    The same devotional goes out to 3 different churches.
    I have a second TABLE called EDITED that holds an edited version of the daily devotional, containing:
    edit_id
    calendardate
    etitle
    escripture
    ebody
    The query should look in the edited table for a devotional first to see if it matches the current date then send it out. Otherwise it sends out the default devotional  that corresponds with the current date.
    I would like to send out in replacement of the default devotional  to the church that edited the devotional.
    I am using the following outer Join but it doesn’t work. It sends the same devotional to everybody.
    <cfoutput>
    <cfloop query="getClients">
    <!--- determine if there is an edited version of the devotional available for this day --->
    <cfquery name="getDevotional" datasource="#application.dsn#">
    SELECT mobile.mob_id, mobile.display_date, mobile.title, mobile.body, mobile.scripture,edited.edit_id,edited.contact_id,edited.etitle,edited.escripture,edited. ebody
    FROM mobile
    left outer join edited ON mobile.display_date = edited.display_date
    where mobile.display_date = <cfqueryparam value ="#dateformat(now(), "YYYY-MM-DD")#" cfsqltype="cf_sql_date">
    </cfquery>
    What am I missing?

    Yes the getClients grabs all information pertaining to the client and their layout information.
    <cfquery name="getClients" datasource="#application.dsn#">
    select *
    from (subscriber INNER JOIN contacts ON subscriber.contact_id = contacts.contact_id)INNER JOIN layout ON contacts.contact_id = layout.contact_id
    where subscriber.timezone = 3
    </cfquery>
    Below is the logic I used to determine which version to use:
    <cfif getDevotional.edit_id NEQ "">#GetDevotional.etitle#<cfelse>#GetDevotional.title#</cfif>

  • How can define an outer join in the where clause of a flowr statement?

    Hi- In the sample below I'm joining two views based on username but in this case what I really want to use is an outer join instead. What is the syntax for that? I tried the (+) notation but that didn't seem to work..
    CREATE OR REPLACE PROCEDURE proc_ctsi_all is
    XMLdoc XMLType;
    BEGIN
    DBMS_XDB.deleteResource('/public/CTSI/ctsi_all_rpt1.xml',1);
    SELECT XMLQuery(
    '<Progress_Report>
    <Personnel_Roster>
    {for $c in ora:view("CTSI_INVEST_NONPHS_SOURCE_V"),
    $cphs in ora:view("CTSI_INVEST_PHS_SOURCE_V")
      let $username  := $c/ROW/COMMONS_USERNAME/text(),
    $expertise  := $c/ROW/AREA_OF_EXPERTISE/text(),
    $phsorg  := $cphs/ROW/PHS_ORGANIZATION/text(),
    $activitycode  := $cphs/ROW/ACTIVITY_CODE/text(),
    $username2  := $cphs/ROW/COMMONS_USERNAME/text()
    where $username eq $username2
         return
      <Investigator>
       <Commons_Username>{$username}</Commons_Username>
    <Area_of_Expertise>{$expertise}</Area_of_Expertise>
    <Federal_PHS_Funding>
    <Organization>{$phsorg}</Organization>
    <Activity_Code>{$activitycode}</Activity_Code>
    <Six_Digit_Grant_Number>{$grantnumber}</Six_Digit_Grant_Number>
    </Federal_PHS_Funding>
    </Investigator>}
    </Personnel_Roster>
    </Progress_Report>'
    RETURNING CONTENT) INTO XMLdoc FROM DUAL;
    IF(DBMS_XDB.CREATERESOURCE('/public/CTSI/ctsi_all_rpt1.xml', XMLdoc)) THEN
    DBMS_OUTPUT.PUT_LINE('Resource is created');
    ELSE
    DBMS_OUTPUT.PUT_LINE('Cannot create resource');
    END IF;
    COMMIT;
    END;
    /

    What you could do is use query within an XMLTable syntax. Via the COLUMNS parameter you then pass the "column" as XMLType to the following XMLtable statement.
    little bit like the following
    select hdjfdf
    from xmltable
       ({xquery}
        PASSING
        COLUMNS xmlfrag xmltype path 'xxx'
       ) a
    ,  xmltable
       ({the other stuff you need}
        PASSING a.xmlfrag
       ...etc
      ...etc                 I guess something simular can be done via XQuery straight away as well

  • How to Specify Left Outer Join in OWB

    If I run the query:
    select s.school_id,
    nvl(max(decode(cv.cat_id, 'UCL', cv.long_desc, null)),'Unknown') UCL,
    nvl(max(decode(cv.cat_id, 'REGION', cv.long_desc, null)),'Unknown') REGION,
    nvl(max(decode(cv.cat_id, 'TREASREG', cv.long_desc, null)),'Unknown') TREASREG,
    nvl(max(decode(cv.cat_id, 'RELGN', cv.long_desc, null)),'Unknown') RELGN,
    nvl(max(decode(cv.cat_id, 'NGEFF', cv.long_desc, null)),'Unknown') NGEFF,
    nvl(max(decode(cv.cat_id, 'PCAP', cv.long_desc, null)),'Unknown') PCAP,
    nvl(max(decode(cv.cat_id, 'ATSIC', cv.long_desc, null)),'Unknown') ATSIC
    from sdw.sdr_schools s
    left outer join
    sdw.sdr_school_category_values scv on s.school_id = scv.school_id
    left outer join
    sdw.sdr_category_values cv on cv.cat_id = scv.cat_id
    and cv.cat_value_id = scv.cat_value_id
    group by s.school_id
    order by s.school_id
    I get 1706 records. In OWB I get 1656 records.
    In OWB I use a JOIN for the three tables, then an expression for the decode lines and sort and then the final table. In the SQL above, if the second left outer join is removed I get 1656 records?
    Ho do you force OWB to produce 1706 records?

    You have to use the (+) notation.
    e.g.
    table1.column1 (+) = table2.column1
    Also, you can do a full-outer-join using table1.column1 (+) = table2.column1 (+) even though this is not legal SQL*Plus syntax.

  • How to specify an outer join in query builder

    I've very quickly built a large query with the query builder, and it works fine, but only produces 9 out of 2200 records - so I need to change it to an outer join.
    My problem is that I can't seem to find a way to specify an outer join. I've tried editing the query that query builder formed, but it won't let me.
    I know I can capture the query, edit it and run it in sql developer, and that works fine, but I want to use query builder as it is the fastest way I know of to quickly add and remove items - my users are unsure of exactly what to include.
    I know it is kind of a trivial question, but i've searched the forum, the manual, the web and no luck
    Thanks for any help you can give
    Glenn

    Hi Glenn,
    When you use the Query Builder to create the sql statement, you should click on the empty square to the right of the fields on each table to create the join. When you've done this, you should see a line drawn between the two tables. Click on this line and a small popup appears allowing you to select inner, left outer or right outer joins.
    Once the report has been created, though, you need to edit the statement. For example, if you use the Query Builder to join DEPT to EMP based on the DEPTNO field on both tables, you get:
    select      "DEPT"."DEPTNO" as "DEPTNO",
          "DEPT"."DNAME" as "DNAME",
          "DEPT"."LOC" as "LOC",
          "EMP"."EMPNO" as "EMPNO",
          "EMP"."ENAME" as "ENAME",
          "EMP"."JOB" as "JOB",
          "EMP"."MGR" as "MGR",
          "EMP"."HIREDATE" as "HIREDATE"
    from      "EMP" "EMP",
          "DEPT" "DEPT"
    where   "DEPT"."DEPTNO"="EMP"."DEPTNO"Change this to:
    select      "DEPT"."DEPTNO" as "DEPTNO",
          "DEPT"."DNAME" as "DNAME",
          "DEPT"."LOC" as "LOC",
          "EMP"."EMPNO" as "EMPNO",
          "EMP"."ENAME" as "ENAME",
          "EMP"."JOB" as "JOB",
          "EMP"."MGR" as "MGR",
          "EMP"."HIREDATE" as "HIREDATE"
    from      "EMP" "EMP"
          LEFT OUTER JOIN "DEPT" "DEPT" ON "DEPT"."DEPTNO"="EMP"."DEPTNO"Andy

  • How to use multiple outer join in ODI

    SELECT
    Count(*)
    FROM
    student S,
    department D,
    course C
    WHERE
    D.S_Name=S.S_Name
    AND D.Dept_Name = C.Dept_Name (+)
    and S.C_Name =C.C_Name (+)
    And (D.Dept_ID = 1);
    I run this query. I got an ORA-01417 error.

    In topology change the join option to Ordered ISO
    then rewrite your query with ANSI syntax.
    SELECT
    Count(*)
    FROM
    student S join department D on D.S_Name=S.S_Name,
    student S right outer join course C on S.C_Name =C.C_Name,
    department D right outer join course C on S.C_Name =C.C_Name
    where
    (D.Dept_ID = 1);
    First verify the code in sql client befor implementing it in ODI
    Thanks,
    Sutirtha

  • How to use "left outer join" in SQVI

    Dear ALL ,
    I want to match MARA materials with BOM material table (MAST,STPO)material or Routing material table (MAPL,PLPO) and I want the list of NONMATCHING material codes from SQVI.
    How to get these items which do not match in 2 tables........?
    I have to work with SQVI + EXCEL ( VLOOKUP ) in excel sheet.
    Thanks...

    Kishore,
    After selecting the table join option, In layout mode enter the table names in Joined tables tab. Select the 2 tables using check boxex and select the join type like left inner and click on define condition. This would create a left inner join. Similarly carry out for the next 2 tables.
    Hope it is useful. If so reward your points.
    Regards
    Ram

  • How to make a outer join dynamically

    I need to make a a dynamic join based on column values ie I want to do the following for ex. IF a.column1='A' and a.column2='B' then my where clause should be a.job_num=b.job_num(+) and a.po_num=b.po_num(+)
    ELSE my join caluse should be
    a.po_num=b.po_num(+).
    Has anyone ideas?.
    I do not want to check conditions and concatenate the string to make the appropriate sql

    It doesn't necessarily have to be dynamic SQL.
    begin
      select column1, column2 into var1, var2 from table1 ;
      if var1 = 'A' and var2 = 'B'
      then
        select more_columns into var_columns
        from table2 a, table 3 b
        where a.job_num=b.job_num(+) and a.po_num=b.po_num(+) ;
      else
        select more_columns into var_columns
        from table2 a, table 3 b
        where a.po_num = b.po_num(+). ;
    end ;

  • How to use outer join condition in my below query.

    Hi All,
    How to use outer join condition in my below query.
    In the table  APPS_JP.GEDIS_OFFER_HEADER goh I have more records
    in the table APPS_JP.GEDIS_ORDER_BUILDS gob I have less number of records.
    I want all the records from APPS_JP.GEDIS_OFFER_HEADER goh
    including other conditions.
    I have tried goh.OFFER_NO=gob.OFFER_NO(+) but same result.
    [code]SELECT   GOH.ORIG_SYSTEM,
               gsp.USER_NAME,
               goh.ORDER_NO,
               goh.OMEGA_ORDER_NUMBER,
               goh.ORDER_TYPE,
               gc.CUSTOMER_ID,
               gc.OMEGA_CUSTOMER_NUMBER,
               CASE WHEN gc.PRIVATE = 'N' THEN gc.CUSTOMER_NAME ELSE '' END
                  AS COMPANY_NAME,
               goh.ORDER_STATUS,
               goh.TOTAL_SELLING_PRICE,
               goh.TOTAL_MARGIN,
                  ga1.ADDRESS1
               || ','
               || ga1.ADDRESS2
               || ','
               || ga1.ADDRESS3
               || ','
               || ga1.POSTAL_CODE
               || ','
               || ga1.CITY
                  AS SHIPPING_ADDRESS,
                  ga2.ADDRESS1
               || ','
               || ga2.ADDRESS2
               || ','
               || ga2.ADDRESS3
               || ','
               || ga2.POSTAL_CODE
               || ','
               || ga2.CITY
                  AS BILLING_ADDRESS,
               ga.ADDRESS_ID,
               gol.DESCRIPTION,
               APPS_JP.TZ.to_local_date (goh.OFFER_DATE, goh.OFFER_DATE_UTC)
                  AS OFFER_DATE,
               gc.LEVEL_8,
               goh.NO_OF_BUILDS,
               gob.SFDC_ID,
               goh.PURCHASE_ORDER_NO AS PO,
               gc1.CUSTOMER_NAME AS END_USAGE,
               gol.LOB,
               goh.TOTAL_MARGIN_PCT,
               goh.TOTAL_DISCOUNT,
               goh.TOTAL_DISCOUNT_PCT
        FROM   APPS_JP.GEDIS_OFFER_HEADER goh,
               APPS_JP.GEDIS_ORDER_BUILDS gob,
               APPS_JP.GEDIS_ORDER_LINES gol,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER gorc,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER ship,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER bill,
               APPS_JP.GEDIS_CUSTOMER gc,
               APPS_JP.GEDIS_CUSTOMER gc1,
               APPS_JP.GEDIS_CONTACT gct,
               APPS_JP.GEDIS_ADDRESS ga,
               APPS_JP.GEDIS_ADDRESS_NORM ga1,
               APPS_JP.GEDIS_ADDRESS_NORM ga2,
               (SELECT   DISTINCT SALESPERSON_ID, USER_NAME
                  FROM   APPS_JP.GEDIS_SALESPERSON
                 WHERE   SALESPERSON_ID IN
                               (SELECT   TO_NUMBER (COLUMN_VALUE) AS SALESPERSON_ID
                                  FROM   TABLE (APPS_GLOBAL.SplitString ('337309'))))
               gsp
       WHERE       goh.ORDER_NO <> 0
               AND goh.OFFER_NO <> 0
               AND goh.OFFER_NO=gol.OFFER_NO
               AND gol.BUILD_NO = 1
               AND gol.LINE_NO = 1
               AND goh.OFFER_NO=gob.OFFER_NO
               AND gob.BUILD_NO = 1
               AND goh.OFFER_NO = gorc.OFFER_NO
               AND gct.CONTACT_ID = gorc.CONTACT_ID
               AND ga.CUSTOMER_ID = gc.CUSTOMER_ID
               AND ga.PRIMARY = 'Y'
               AND goh.LEAD_SALESPERSON=gsp.SALESPERSON_ID
               AND goh.OFFER_NO = ship.OFFER_NO
               AND ship.RELATION_TYPE = 'SHIP'
               AND ga1.ADDRESS_ID = ship.ADDRESS_ID
               AND ga1.CUSTOMER_ID = gc1.CUSTOMER_ID
               AND goh.OFFER_NO = bill.OFFER_NO
               AND bill.RELATION_TYPE = 'BILL'
               AND ga2.ADDRESS_ID = bill.ADDRESS_ID
               AND goh.OFFER_DATE BETWEEN APPS_JP.TZ.LOCAL_TO_DB_DATE (
                                             SYSDATE - 30
                                      AND  APPS_JP.TZ.LOCAL_TO_DB_DATE (SYSDATE)
               AND gorc.RELATION_TYPE = 'BASE'
               AND gorc.CUSTOMER_ID = gc.CUSTOMER_ID
               AND goh.SALES_CHANNEL = gc.SALES_CHANNEL
               AND gc.SALES_CHANNEL = 'SMB'
               AND goh.LEAD_SALESPERSON IN (goh.CREATED_BY, goh.LEAD_SALESPERSON)
    ORDER BY   goh.OFFER_NO;[/code]
    Please help me how to use this outer join condition.
    Thanks in advance.

    Hi,
    If you want all the rows from goh, then you don't want any conditions like  goh.OFFER_NO <> 0.
    Make all the joins to goh outer joins, and make all conditions that apply to any tables joined to goh (or to tables joined to them) part of the join condition, like this:
    FROM             APPS_JP.GEDIS_OFFER_HEADER     goh
    LEFT OUTER JOIN  APPS_JP.GEDIS_ORDER_BUILDS     gob  ON   gob.OFFER_NO = goh.OFFER_NO
                                                         AND  gob.BUILD_NO = 1
    LEFT OUTER JOIN  APPS_JP.GEDIS_ORDER_LINES      gol  ON   gol.OFFER_NO = goh.OFFER_NO
                                                         AND  gol.BUILD_NO = 1
                                                         AND  gol.LINE_NO  = 1
    LEFT OUTER JOIN  APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER
                                                    gorc ...
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Simplify the problem as much as possible.  For example, do you really need all those tables to show what the problem is?  Of course, you need them in tyour real query, but if you understand a solution that only involves 4 or 5 tables, you'll know how to apply it to any number of tables.
    Explain, using specific examples, how you get those results from that data.Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ https://forums.oracle.com/message/9362002#9362002

  • How to create a condition with out join

    Hi all,
    I m using Oracle Discovere Desktop. I want to know that how can i use outer join in conditions.
    e.u.
    category(+) = 'E'
    Regards

    Hi,
    Actually i want to use both equi join and outer join in my one worksheet I have discussed with Micheal and he told me that this is not possible. Because whenever you create more then one condition between two same folders then you have to choose only one condition prompted by Desktop during creation of worksheet.
    Anyway thanks for reply.
    Best Regards,
    Hassan

  • OUTER JOINS

    I am a user of Dicoverer 4.1 and I write queries from the EUL. I need help in writing my query that will return all records in Table A and matching and Null values from Table B. A simple employee roster with all Names(Table A)and all addresses(Table B)including Null addresses. Here is the exact sql statement I get from a simple query that only gives me employees who have addresses (I know there are some who don't have addresses).
    SELECT POSITION_EMPLOYEE_SECV.NAME_PERS, ADDRESS_SECV.LOCAL_ADDR_CITY
    FROM CSUDB.POSITION_EMPLOYEE_SECV POSITION_EMPLOYEE_SECV, CSUDB.ADDRESS_SECV ADDRESS_SECV
    WHERE ( ( POSITION_EMPLOYEE_SECV.SSAN_EMPL_CON_NR = ADDRESS_SECV.SSAN_EMPL_CON_NR ) );
    How do I write the outer join that will give me all employees and include the ones with no address?
    Thanks.

    Change the where clause to-
    WHERE ((POSITION_EMPLOYEE_SECV.SSAN_EMPL_CON_NR = ADDRESS_SECV.SSAN_EMPL_CON_NR(+)));
    Good luck!

Maybe you are looking for

  • Starting up in Itunes, Please Help

    Ok, So here is my problem. I Connect My ITouch tomy computer I go on Itunes and it say under Devices that there is a Ipod. When You Click On the that its say I need to register, well heres the problem when I click on register it then i get a page tha

  • Add hyperlink on the field txt in Search Result List to access Detail View

    Hi, SDN fellows. I have a PCUI requirement stated the following: 1) In the line item of the Search Result List (table), there is one hyperlink in field 1. 2) When click on the hyperlink, it will trigger the action to open up Detail View (Object Data

  • Not able to convert to PDF using ShareAPI.addFile

    Hi, I am using Java library to use acrobat.com service of converting word doc to PDF. I am using following call to upload the doc for converion: node= shareAPI.addFile(acrobatUser, uploadFile, uploadFile.getName(), "Test doc",null, false,true); node.

  • Dreamweaver CS6 Fluid Grid Layout

    I fear there may not be a solution to this issue! I have placed several hotspots on an image in a Fluid Grid Layout div in DW CS6 and the problem is quite straightforward. Whilst the "image" reduces perfectly when viewed in Tablet and Smartphone scre

  • Does any one know of a cood shopping cart?

    I tried cartweaver and they are a ripoff. I need a shopping cart to add to one of my sites, if anyone knows of one please help.