How to use outer join in Corelated Update?

Hi,
I am using outer join in correlated update comand. But it is not updating the line which is not retrived from the query. Below is the example.
Update model_table a
Set a.model = (Select b.model_name from parts_table b
                    where b.model_id (+) = a.model_id)Check the above query and please let me know whether can user like this or not?
Thanks

Updating the values you want through subqueries is tricky. The correlated update should perform okay if the join columns are indexed but updating the correct rows may take some thought.
You might need to add a WHERE clause to the update to use the subquery to only update the rows when the subquery return value is not null - if this is what you want. Something like
Update model_table a
Set a.model = (Select b.model_name from parts_table b
                    where b.model_id = a.model_id)
where exists (Select b.model_name from parts_table b
                    where b.model_id = a.model_id)Edited by: riedelme on Jan 4, 2010 5:59 AM

Similar Messages

  • 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 use outer join on 3 tables

    how to use outer join on 3 tables
    say tables are mkpf,lips and vbrp
    mkpf-xblnr = lips-vbeln
    lips-vbeln  = vbrp-vgbel

    refer following querry
        select a~bukrs
               a~anln1
               a~ord42
               a~ord43
               b~afabe
               b~ndabj
               b~kaafa
               b~aafag
               c~kostl
               d~afasl
               d~ndjar
               d~ndper
        into corresponding fields of table gt_master
        from ( ( anla as a inner join anlc as b
        on abukrs = bbukrs
        and aanln1 = banln1
        and aanln2 = banln2 )
        inner join anlz as c
        on  abukrs = cbukrs
        and aanln1 = canln1
        and aanln2 = canln2 )
        inner join anlb as d
        on  abukrs = dbukrs
        and aanln1 = danln1
        and aanln2 = danln2
        where a~bukrs in s_comp.

  • How to use outer join in Target table

    hi all:
    how to use outer joing and trunc in target table?

    Good morning,
    Can you be more specific?
    What do you want to join, what needs to be truncated, what's the Loading Type of your target table-object, etc.
    In general the following applies.
    An outer join is specified on the JOIN operator, under Operator Properties you can specify the Join Condition, for example:
    tab1.uk_col1 = tab2.uk_col1(+)
    and
    tab1.uk_col2 = tab2.uk_col2(+)Truncating a table in a mapping can only be done in combination with inserting the dataset, setting the loading type of a table to TRUNCATE/INSERT.
    Apart from that there is a predefined OWB transformation called WB_TRUNCATE_TABLE, this can also be used to truncate a table.
    Cheers, Patrick

  • How to use outer join to display the results

    I want to develop a report in which the column sequence will be as follows:
    1)Item_code
    2)Item_name
    3)Stock
    4)Pending
    5)Re-order Level
    6)Item_reorder_qty
    I had written the query, but the problem is all the products does not get displayed. The products are more than 700. But after running the query, only 364 gets displayed.
    How i can make use of outer join in the following statements :
    AND ITEM_CODE = LCS_ITEM_CODE
    AND ITEM_CODE = PI_ITEM_CODE
    AND LCS_ITEM_CODE = PI_ITEM_CODE
    in the below given query to solve this.
    SELECT
    ITEM_CODE,
    ITEM_NAME,
    ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU- LCS_REJECT_QTY_BU)/IU_MAX_LOOSE_1)STK ,
    SUM(TO_NUMBER(PI_QTY||'.'||PI_QTY_LS) - (PI_GI_QTY_BU/IU_CONV_FACTOR/IU_MAX_LOOSE_1))PNDG,
    ITEM_RORD_LVL,
    ITEM_RORD_QTY
    FROM
    OM_ITEM,
    OM_ITEM_UOM,
    OT_PO_HEAD,
    OT_PO_ITEM,
    OS_LOCN_CURR_STK
    WHERE (ITEM_UOM_CODE = IU_UOM_CODE AND ITEM_CODE = IU_ITEM_CODE)
    AND ITEM_CODE = LCS_ITEM_CODE
    AND ITEM_CODE = PI_ITEM_CODE
    AND LCS_ITEM_CODE = PI_ITEM_CODE
    AND LCS_LOCN_CODE ='RM'
    AND PI_PH_SYS_ID = PH_SYS_ID
    GROUP BY ITEM_CODE,ITEM_NAME,LCS_STK_QTY_BU,LCS_RCVD_QTY_BU,LCS_ISSD_QTY_BU,LCS_REJECT_QTY_BU,IU_MAX_LOOSE_1,ITEM_RORD_LVL,ITEM_RORD_QTY
    ORDER BY ITEM_CODE ASC
    Yogesh

    As you have no table aliases I can't tell what columns relate to which tables on your join conditions.
    Can you not just put (+) next to the outer joined columns you require on the where clause? Or perhaps consider using ANSI syntax for the joins such as <tableA> LEFT OUTER JOIN <tableB> ON (<join conditions>)

  • How to use OUTER JOIN in Oracle Answers Filters?

    Hi, I need to have a filter on an 'Oracle Answers' report.
    The query from the NQQuery.log appears as below. (I have simplified the SELECT clause here for easy reading)
    SELECT t692.enquiry_business_route AS c1,
    t692.enquiry_id AS c11, t913.YEAR AS c12,
    t913.full_date AS c13, t666.surname AS c14,
    t666.post_code AS c15, t855.company_name AS c16,
    t983.notes AS c30
    FROM
    mkt_dw_enev_enhi_dim t983,
    mkt_dw_key_partner_dim t855,
    mkt_dw_event_type_dim t821,
    mkt_dw_customer_dim t666,
    mkt_dw_time_dim t913,
    mkt_dw_enquiry_event_fact t692
    WHERE (
    t692.enquiry_id = t983.enqu_id
    AND t666.customer_dim_key = t692.customer_dim_key
    AND t692.event_date_time_key = t913.time_dim_key
    AND TRUNC(t983.event_date)= t913.FULL_DATE
    AND t692.event_type = t821.event_type_dim_key
    AND t692.key_partner_dim_key = t855.key_partner_dim_key
    AND t821.event_type_category = 'RECEIVE_FEE'
    AND t913.YEAR = 2009
    and t692.enquiry_id = 535986
    For the following two lines I would like to have the OUTER JOIN.
    AND t692.event_type = t821.event_type_dim_key(+)
    AND t821.event_type_category(+) = 'RECEIVE_FEE' (THIS IS THE FILTER CONDITION, AT THE MOMENT IT DOESN'T WORK WITH OUTER JOIN SYMBOL)
    Please could you let me know the best way of achieving the above.
    Thanks
    Srikanth

    In the BMM layer in the join condition you will be able to specify the join to be (left, right or full outer join).
    You can even add the required table in the LTS(logical table source) and also specify a left, right or full outer join there as well.
    There is an interesting work around as mentioned in the below blog to get to the Outer join results with out changing anything in rpd but in Answers.
    http://obiee101.blogspot.com/2008/11/obiee-outerjoin-workaround.html
    Hope it helps
    Thanks
    prash

  • How to use outer join on 2 tables with Oracle 8i

    Could anyone tell me the Oracle 8i syntax equivalent to :
    select user.name, city.adress, contry.name
    from user
    left outer join city on (user.rCity = city.code)
    left outer join country on (user.rCountry = country.code)
    I tried following :
    select user.name, city.adress, contry.name
    from user, city, contry
    where user.rCity (+) = city.code
    and user.rCountry (+) = country.code
    but displayed following error :
    ORA-01417: a table may be outer joined to at most one other table
    Thank you

    Logically I would expect a user to have a city and a country, or not. In that case the outer join should be on the other tables. Making your query:
    select user.name, city.adress, country.name
    from user, city, country
    where user.rCity = city.code (+)
    and user.rCountry = country.code (+);

  • How to use outer join on this query?

    Hi all,
    Hope doing well,
    sir i am having one query which is here
    SELECT C.* ,
    P.Comp_Name Parent
    FROM Comp_Master C
    LEFT JOIN Comp_Master P
    ON C.Parent_ID = P.Comp_ID
    WHERE C.Comp_ID = 5;
    and here is my table Comp_Master data like this:
    Comp_ID Parent_ID Comp_Name
    5 1 abc123
    1 ROOT abc@123
    after running this query with all column value in parent column abc@123 value should come. but it's not happening.
    could u check this.
    if any query please let me know.
    Thanks

    p.s. when I run your query against your data....
    SQL> ed
    Wrote file afiedt.buf
      1  with comp_master as (select '5' comp_id, '1' parent_id, 'abc123' comp_name from dual union all
      2                       select '1' comp_id, 'ROOT' parent_id, 'abc@123' comp_name from dual
      3                      )
      4  --
      5  -- end of simulated table of test data
      6  --
      7  SELECT C.*
      8        ,P.Comp_Name Parent
      9  FROM Comp_Master C
    10       LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID
    11* WHERE C.Comp_ID = 5
    SQL> /
    C PARE COMP_NA PARENT
    5 1    abc123  abc@123I get the output I expect from that query.
    So what are you expecting?
    I just ran the equivalent in SQL Server (I can't believe you got me to go and run that piece of rubbish... I haven't touched it in ages)...
    with comp_master as (select '5' comp_id, '1' parent_id, 'abc123' comp_name union all
                         select '1' comp_id, 'ROOT' parent_id, 'abc@123' comp_name
    SELECT C.*
          ,P.Comp_Name Parent
    FROM Comp_Master C
         LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID
    WHERE C.Comp_ID = 5... and it gave me the same output.

  • When i update apps on my iphone they need the ID that i used when i downloaded these app and i forgot this ID and a make a new ID how i used the new one to update these apps thanks

    Hello all,
    when i update apps on my iphone they need the ID that i used when i downloaded these apps and i forgot this ID and a make a new ID
    How i used the new one to update these apps?
    thanks

    Your device can hold apps from multiple IDs, but to update them you have to swicth identities which is time consuming. If possible use only the one ID. If you need to reset the password for your old ID visit My Apple ID.
    tt2

  • How to make outer join in Sub Query?

    Hi!
    I'm facing one problem. Can anyone tell me - how to make outer join in sub query?
    I'm pasting one sample code -
    select e.empno, e.ename,e.job,e.sal,d.deptno,d.dname
    from d_emp e, d_dept d
    where e.deptno(+) = (
                          case
                            when d_dept.deptno = 10
                              then
                                  select deptno
                                  from d_dept
                                  where dname = 'SALES'
                          else
                            d_dept.deptno
                          end
    SQL>
    ERROR at line 15:
    ORA-01799: a column may not be outer-joined to a subqueryHow to resolve this issue?
    Regards.

    And any luck with this?
    SQL> with emp as
      2  (select 100 empno, 'Abcd' ename, 1000 sal, 10 deptno from dual
      3  union all
      4  select 101 empno, 'RRR' ename, 2000 sal, 20 deptno from dual
      5  union all
      6  select 102 empno, 'KKK' ename, 3000 sal, 30 deptno from dual
      7  union all
      8  select 103 empno, 'PPP' ename, 4000 sal, 10 deptno from dual
      9  )
    10  ,dept as
    11  (select 10 deptno, 'FINANCE' dname from dual
    12  union all
    13  select 20 deptno, 'SALES' dname from dual
    14  union all
    15  select 30 deptno, 'IT' dname from dual
    16  union all
    17  select 40 deptno, 'HR' dname from dual
    18  )
    19  select e.empno, e.ename, e.sal, d.deptno, d.dname
    20  from emp e,
    21       (select decode(a.deptno, 10, b.deptno, a.deptno) deptno, decode(a.deptno, 10, b.dname, a.dname) dname
    22      from dept a, (select deptno, dname
    23                    from dept
    24                      where dname = 'SALES'
    25                     ) b
    26       ) d
    27  where e.deptno(+) = d.deptno
    28  /
         EMPNO ENAM        SAL     DEPTNO DNAME
           101 RRR        2000         20 SALES
           101 RRR        2000         20 SALES
           102 KKK        3000         30 IT
                                       40 HR
    SQL> Cheers
    Sarma.

  • Sample code and senarios to use outer join?

    We know the ABAP4 syntax for inner join, but never tried outer join and we even don't know if there is any outer join syntax in ABAP4 or not.  Would be very appreciated if some ABAP expert here let us know if there is any outer join and list the difference between inner join and outer join with detailed senarios or when we would use outer join or when to use inner join?  Also give a sample code on the outer join if there is any in ABAP?
    Thanks and we will give you reward points!

    Hye..
    Left outer join between table 1 and table 2 where column D in both tables set the join condition:
    Table 1                      Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
        Left Outer Join
        |--||||||||--|
        | A  | B  | C  | D  | D  | E  | F  | G  | H  |
        |--||||||||--|
        | a1 | b1 | c1 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a2 | b2 | c2 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a3 | b3 | c3 | 2  |NULL|NULL|NULL|NULL|NULL|
        | a4 | b4 | c4 | 3  | 3  | e2 | f2 | g2 | h2 |
        |--||||||||--|
    Example
    Output a list of all custimers with their bookings for October 15th, 2001:
    DATA: CUSTOMER TYPE SCUSTOM,
          BOOKING  TYPE SBOOK.
    SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
           SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKID
           INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
                 BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
                 BOOKING-BOOKID)
           FROM SCUSTOM LEFT OUTER JOIN SBOOK
             ON SCUSTOMID = SBOOKCUSTOMID AND
                SBOOK~FLDATE = '20011015'
           ORDER BY SCUSTOMNAME SBOOKFLDATE.
      WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
               BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
               BOOKING-BOOKID.
    ENDSELECT.
    Reward if helpful.
    Thanks.
    Imran.

  • Dont want to use outer joins

    Hi Guys,
    I have some data in lookup tables and in the main tables the foreign keys are nullable. For this I have to use outer join query. But as it matters on performance because I am using 100's of tables like this and its making the query really slow. Is there any other way to get rid of outer join and get the same result??
    Thanks in advance.
    Ghulam Mustafa Butt

    First, why "avoid outer joins at all costs"? If you need the functionality of an outer join, using an outer join is the best option.
    Second, I don't see where 161992's code does anything other than an inner join in a slighly more convoluted form.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How To use the Task Service to update  a task's outCome

    Hello EveryBody,
    I started with SOA suite 11g two months ago. I am trying all the possibilities to convaince my bosses of this technology.
    My problem is how to use the task service to update an outcome. I have already succeeded to create a client of the task query service.
    Thank you

    You can use Task Service API's to update any properties of a task:
    In your case, to update the outcome of the task, you can use the following API:
    Task updateTaskOutcome(IWorkflowContext context,
    java.lang.String taskId,
    java.lang.String outcome)
    throws StaleObjectException,
    WorkflowException
    For more details, look into the following links:
    http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10224/bp_workflow.htm#BACHEFDH
    http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e10660/oracle/bpel/services/workflow/task/ITaskService.html#updateTaskOutcome_oracle_bpel_services_workflow_verification_IWorkflowContext__java_lang_String__java_lang_String_
    Thanks,
    Navaneeth

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

  • Issues with using Outer join in Data Template

    Hi all,
    this is my data in two tables .
    Table Ronny1
    colA colB
    1 u
    2 v
    3 x
    Table Ronny2
    colC colD
    1 q
    2 r
    This is my data template
    <dataTemplate name="MGF" dataSourceRef="Source1">
         <dataQuery>
              <sqlStatement name="Q1" dataSourceRef="Source1">
                   <![CDATA[select C, D  from Ronny2]]>
              </sqlStatement>
              <sqlStatement name="Q2" dataSourceRef="Source2">
                   <![CDATA[select A , B from lokesh1 where A = :C]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G1" source="Q1">
                   <group name="G2" source="Q2">
                        <element name="A" value="A"/>
                        <element name="B" value="B"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>
    Now this would give me result as
    A B
    1 u
    2 v
    however my requirement is this
    A B
    1 u
    2 v
    3 x
    that is, i want to display all the rows of table Ronny1 and matching rows from table Ronny2. I tried modifiying my second sql as
    <![CDATA[select A , B from lokesh1 where A = :C (+)]]> ( using a outer join)
    but this does give me correct data and comes back with the cartesion product.
    Can anyone please answer this for me that how can we use the outer join in data templaes.
    Thanks
    Ronny

    hey vetsrini,
    sorry for the confusion here,
    actually i want to display all the rows from table Ronny1 and i am also pulling in the matching rows from table Ronny2 and my data structure looks as ( pulling in column D from table Ronny2)
    <dataStructure>
    <group name="G1" source="Q1">
    <group name="G2" source="Q2">
    <element name="A" value="A"/>
    <element name="B" value="B"/>
    <element name="D" value="D"/>
    </group>
    </group>
    </dataStructure>
    and this is what i want the output to be
    A B D
    1 u q
    2 v r
    3 x
    Hence the row where A <> C the data in the D column will be null, same as in the case of outer join.
    any suggestions
    Thx
    Ronny

Maybe you are looking for

  • Best practice on 'from dev to test'move.

    Hello. My Repository 10.2.0.1.0 My client 10.2.1.31 I am writing to ask someone what would be the best practice and most common_sense_oriented way to move OWB from dev to qa/test environment? I have read a number of recommendations on this forum and

  • New e-mail not appearing in ios 7

    I recently upgraded to iOS 7 and have noticed an issue with the Mail app.  The badge on the app will show a new e-mail has arrived, but when I go into the app, even though it says "Updated Just Now", the new mail isn't there.  If I pull the screen do

  • Iphone 5 back camera problem after update to IOS 8. Focus doesn't work on back camera!

    My device is Iphone 5 64gb IOS 8. I have problem after update to IOS 8. When i run camera.. I hear some scratch inside my phone. And focus of back camera doesn't work. 1. How can i fix it? 2. Or how to rollback to IOS 7+ ? 3. Should i come to app sto

  • HT4191 Can I restore my NOTES mailbox to MAIL from a Time Machine backup?

    I am new to the world of discussion so please bear with me.  In trying to resolve a syncing problem between the iMac and iPad, I seem to have somehow deleted all the Notes we had stored.  Can I restore from a Time Machine backup?

  • Frm-41830 the list didn't contain entries

    hi dear all, the following query give no error and return records when i execute it in toad. but the lov didn't return any records. frm-41830 the list didn't contain entries. SELECT ALL AP_VENDORS.VENDOR_ID, AP_VENDORS.VENDOR_NAME, AP_VENDOR_TYPE.TYP