Update query to fixed value while joining to multiple tables

We have a lot of phone country codes that are blank or incorrect. For example, Egypt's phone country code is 20. I want to update the phone country code to 20 but only if the country in the locations table = 'EG' and there is in fact a location record (it's possible a party has a phone number but not a physical address in which case there is insufficient information to update the phone country code to 20. Here's what I have thus far which does not work.
update ar.hz_contact_points hzcp
set hzcp.phone_country_code = 20
join ar.hz_party_sites hzps on hzps.PARTY_ID = hzcp.OWNER_TABLE_ID
join ar.hz_locations hzl on hzl.LOCATION_ID = hzps.location_id
where 1=1
and hzcp.owner_table_name = 'HZ_PARTIES'
and hzl.location_id = hzps.location_id
and hzl.country = 'EG'
and hzcp.phone_country_code not like '20'
and hzcp.contact_point_id = '54060443' --(Note I'm limiting it just to one record for testing.)Thanks in advance!

Just slightly different
update ar.hz_contact_points hzcp
   set hzcp.phone_country_code = 20
where hzcp.phone_country_code != 20
   and hzcp.owner_table_name = 'HZ_PARTIES'
   and hzcp.contact_point_id = 54060443   --(Note I'm limiting it just to one record for testing.)
   and exists(select null
                from ar.hz_party_sites hzps,
                     ar.hz_locations hzl
               where hzps.PARTY_ID = hzcp.OWNER_TABLE_ID
                 and hzl.location_id = hzps.location_id
                 and hzl.country = 'EG'
             )Regards
Etbin

Similar Messages

  • How to tune the query for duplicate records while joining the two tables

    hi,i am executing the query which has retrieving multiple tables,in which one of them has duplicate record,how to get single record

    Not enough info...subject says "tune" the query, message says "write" the query...and where is actual query that you had tried ?

  • Oracle outer join on  multiple tables throws error

    Hi ,
    We are using ansi joins with outer joins on multiple tables in oracle 9i.
    Now these queries have to be used in Oracle8i.
    Since Oracle8i does not support ansi sql we are replacing the ansi sql queries with the oracle joins.
    On trying the same we found that the following query
    select *from tab1 a, tab2 b, tab3 c where a.c1 = b.col1(+) and c.c2 = b.col2 (+)
    throws the error
    ORA-01417: a table may be outer joined to at most one other table.
    Is there a way to simulate this query without using the outer joins on multiple tables?
    thanks

    Try writing the query in this form:
    select * from
    (select t1.col1, t1.col2
    from schema.table1 t1, schema.table2 t2
    where t1.col1 = t2.col1(+)) t4,
    schema.table3 t3 where t4.col2 = t3.col2(+)
    In the subquery, you will have to list all the columns you want to see, and you will need to provide unique aliases for any columns with duplicate names. I tested this on 9i, and don't have an 8i system to work with, so I hope this helps.

  • Join of Multiple Tables

    We are experiencing an unpredictable error in a simple form and have
    experimented it in different scenarios it behaves in the same way.
    The problem description is as under:
    We are using "Join of Multiple Tables" feature of Developer-6i. In our
    forms there are two tables e.g. Emp and Dept. We have set all the
    properties requiered to do this job inluding:
    1. "Query Data Source Name" is set to Emp,Dept.
    2. "Where Cluase" is set to Emp.Deptno = Dept.Deptno
    3. "DML Target Name" is set to EMP.
    4. Manullay created the columns for Dept.Dname.
    5. Set the Query-Only Property to Yes.
    6. Set the Primary Key Property to Yes for Empno
    When we execute this form it performs properly with the normal operations.
    It inserts, updates and delete records properly But in the scenario e.g.
    when we scroll to 5th or any other record greater this number and
    start changing employee name and committing on the each record going
    backward. It generates Primary Key Violation errors after updating
    4-5 records.
    When we locate the error in "Display Error" button it shows the update
    statement as "UPDATE EMP SET WHERE ROWID=:1" and there is no "Field=Value"
    cluase in the UPDATE statement.

    Hi, Mahesh,
    So you want only 1 row of output for each distinct combination of currentpress and lastpcirim?  That sounds like a job for GROUP BY.
    And you want that row to contain a delimited list of all the different typidcontainers?  That sounds like a job for the aggregate LISTAGG function.
    WITH  joined_data  AS
        SELECT DISTINCT
                    mst.curepress, mst.lastpcirim, inf.typeidcontainer
        FROM        betmaster mst
        LEFT JOIN   betinfo   inf   ON  TRIM (mst.curepress) = SUBSTR ( TRIM (inf.currentpress)
                                                                      , 1
                                                                      , 3
    SELECT    curepress, lastpcirim
    ,         LISTAGG (typeidcontainer, ', ')
                  WITHIN GROUP (ORDER BY  typeidcontainer)   AS container_list
    FROM      joined_data
    GROUP BY  curepress, lastpcirim
    Unfortunately, you can't say LISTAGG (DISTINCT ...), so you still have to get the distinct containers the way you're already doing it.  (Notice that the sub-query is just what you posted.)
    Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful.  Don't forget to say which version of Oracle you're using.  LISTAGG was new in Oracle 11.2.
    Why not add CHECK constraints (and maybe triggers) to your tables, so that curepress and currentpress are not stored with leading or trailing spaces?  Then you wouldn't need to use TRIM in queries like this, and your code would be simpler and more efficient.

  • Left outer join using multiple table

    Hi,
    I am trying to use left outer join with multiple tables , the join condition will be based on  PERNR and BEGDA & ENDA for each infotype in selection screen.
      select pa00~pernr pa00~begda pa00~endda pa00~massn pa00~massg pa00~stat2 pa00~aedtm pa00~uname
        pa01~begda pa01~endda pa01~bukrs pa01~persg pa01~persk pa01~mstbr pa01~ename pa01~aedtm pa01~uname
        pa02~begda pa02~endda pa02~nachn pa02~vorna pa02~midnm pa02~aedtm pa02~uname
        pa016~begda pa016~endda pa016~cttyp pa016~aedtm pa016~uname
        into CORRESPONDING FIELDS OF TABLE i_pall
        from  ( PA0000 as pa00 left OUTER JOIN pa0001 as pa01 on pa00~pernr = pa01~pernr )
        left OUTER JOIN pa0002 as pa02 on pa00~pernr eq pa02~pernr )
        left OUTER JOIN  pa0016 as pa016 on pa00~pernr eq pa016~pernr )
        where pa00~pernr in S_pernr
        AND pa00~begda in s_bg0000
        and pa00~endda in s_nd0000.
    but this fails  to fetch the value of begda enda from each pa0000,pa0001,pa0002,pa0016.
    Please help!
    Monirul

    Why don't you use the standard logical database PNPCE and then Provide statement?

  • Update a column with value of column of other table

    Hi,
    I am looking for an update statement for the following scenario
    With following 2 tables
    TABLE1 (Primary A, B)
    TABLE2 (Secondary C , D).
    C Column is not unique.
    Please provide me an update statement to update TABLE1.B with TABLE2.D where TABLE1. A = TABLE2.C
    Please note that TABLE2.C is not unique.
    Please let me know whether this satement is correct.
    UPDATE TABLE1
    SET B = (SELECT DISTINCT D FROM TABLE 2 WHERE A=C )
    Thanks
    Alla Kishore

    UPDATE TABLE1 T1
    SET T1.B = (SELECT DISTINCT D FROM TABLE2 T2 WHERE T2.C=T1.A )

  • Performance Issue while Joining two Big Tables

    Hello Experts,
    We've the following Scenario, wherein we need to have Sales rep associated for a Sales Order. This information is available in VBPA table with Sales Order, Sales Order Item and Partner Function being the key.
    NOw I'm interested in only one Partner Function for e.g. 'ZP'. This table is having around 120 million records.
    I tried both options:
    Option 1 - Join this table(VBPA) with Sales Order Item table(VBAP) within the Data Foundation Layer of the Analytic View and doing the filtering on Partner Function
    Option 2 - Create a Attribute View for VBPA having filtering on Partner Function and then join this Attribute View in the Logical Join Layer with the Data Foundation table.
    Both these options are killing the performance.
    Is there any way out to achieve this ?
    Your expert opinion is greatly appreciated!!
    Thanks & regards,
    Jomy

    Hi,
    Lars is correct. You may have to spend a little bit more time and give a bigger picture.
    I have used this join. It takes about 2 to 3 seconds to execute this join for me. My data volume is less than yours.
    You must be have used a left outer join when joining the attribute view (with constant filter ZP  as specified in your first post) to the data foundation. Please cross check once again, as sometimes my fat finger inadvertently changed the join type and I had to go back and fix it. If this is a left outer join or a referential join, HANA  does not perform the join if you are not requesting any field from the attribute view on table VBPA. This used to be a problem due to a bug in SP4 but got fixed in SP5.
    However, if you have performed this join in the data foundation, it does enforce, the join even if you did not ask any fields from the VBPA table. The reason being that you have put a constant filter ZR (LIPS->VBPA join in  data foundation as specified in one of your later replies).
    If any measure you are selecting in the analytic view is a restricted measure  or a calculated measure that needs some field from VBPA, then the join will be enforced as you would agree. This is where I had most trouble. My  join itself is not bad but my business requirement to get the current value of a partner attribute on  a higher level calculation view sent too much data from analytic view to calculation view.
    Please send the full diagram  of your model and vizplan. Also, if you are using a front end (like analysis office), please trap the SQL sent from this front end tool and include it in the message.  Even a straight SQL you have used in which you have detected this performance issue will be helpful.
    Ramana

  • Duplicates in sql query out put when qury has join on multiple tables.

    I have the below query whcih is returning 2 duplicate records.
    Is there any way how to figure out from which table is causing the duplicate?
    There are so many inline view and join conditions in this query .
    in waht join conditions i need to look into mainly?
    or how to find the whcih table is causing the duplicate when we have multimple joins?
    this is really bothering me a lot .please help me with this.
    SELECT       'BCCALGLB'            model_cd,
                         fi_instrument_id,
                         fmr_cusip             instrument_id,
                         price,
                         '27-FEB-2013'          pricing_dt,
                         currency_cd
                         FROM         (SELECT  II.fmr_cusip,
                                  IAI.fi_instrument_id,
                                  IP.price,
                                  IP.currency_cd
                          FROM    (SELECT  IdxHldg.vendor_instrument_id,
                                           IdxHldg.index_cd,
                                           IdxHldg.data_source_cd,
                                           GM.member_rank,
                                           RANK () OVER (PARTITION BY  IdxHldg.vendor_instrument_id
                                                         ORDER BY      GM.member_rank  ASC)  priority
                                   FROM    (SELECT  IBH.vendor_instrument_id,
                                                    IBH.index_cd,
                                                    IBH.data_source_cd
                                            FROM    fi_idx_benchmark_holdings  IBH
                                            WHERE   IBH.pricing_dt = '27-FEB-2013'
                                            UNION
                                            SELECT  IFH.vendor_instrument_id,
                                                    IFH.index_cd,
                                                    IFH.data_source_cd
                                            FROM    fi_idx_forward_holdings  IFH
                                            WHERE   IFH.pricing_dt = '27-FEB-2013'
                                           )  IdxHldg,
                                           fi_group_member  GM
                                   WHERE   GM.group_cd      = 'BCGLOBALIDX'
                                   AND     GM.purpose_cd    = 'GLOBALIDX'
                                   AND     IdxHldg.index_cd = GM.character_val
                                  )  BCIdxHldg,
                                  fi_idx_instrument  II,
                                  fi_idx_price  IP,
                                  instrument_alternate_id  IAI,
                                  instrument  I
                          WHERE   BCIdxHldg.priority                  =      1
                          AND     BCIdxHldg.data_source_cd            =      II.data_source_cd
                          AND     BCIdxHldg.vendor_instrument_id      =      II.vendor_instrument_id
                          AND     II.data_source_cd                   =      IP.data_source_cd
                          AND     II.vendor_instrument_id             =      IP.vendor_instrument_id
                          AND     IP.currency_cd                      =      I.currency_cd
                          AND     IP.pricing_dt                       =      '27-FEB-2013'
                          AND     II.fmr_cusip                        =      IAI.alternate_id
                          AND     IAI.alternate_id_type_code          =      'FMR_CUSIP'
                          AND     IAI.fi_instrument_id                =      I.fi_instrument_id
                          AND     NVL (I.instrument_domain_cd, 'XXX') NOT IN ('MBS', 'MGEN')
                          AND     NVL (I.instrument_type_cd, 'XXX')   !=     'CMBS'
                          AND     ((I.currency_cd                     NOT IN ('CAD', 'USD'))
                                   OR
                                   (EXISTS (SELECT  1
                                            FROM    adm_calendar_date  ACD,
                                                    ctry_curr_link  CCL
                                            WHERE   TO_DATE (ACD.calendar_yyyymmdd, 'YYYYMMDD') = '27-FEB-2013'
                                            AND     ACD.calendar_origin_cd                      = 'EXCHANGE'
                                            AND     ACD.calendar_type_cd                        = 'BUSINESS'
                                            AND     ACD.geography_cd                            = CCL.ctry_cd
                                            AND     CCL.link_typ                                = 'ISS'
                                            AND     CCL.curr_cd                                 = I.currency_cd
                                            AND     ACD.business_day_ind                        = 'Y'))))

    Hi,
    953115 wrote:
    I have the below query whcih is returning 2 duplicate records.
    Is there any way how to figure out from which table is causing the duplicate?
    There are so many inline view and join conditions in this query .
    in waht join conditions i need to look into mainly?
    or how to find the whcih table is causing the duplicate when we have multimple joins?What has changed since the last time the query ran correctly? (It must have run correctly at some point. You didn't just write a query that big all at once without testing each individual part, did you?)
    Find a small set of sample data that causes the problem. Create and work with tables that have only that small set of data.
    Take baby steps. Start with the most deeply nested sub-query. and simplify it so that it uses only 1 table: comment out all references to other tables. Does it produce exactly what you're expecting, especially the number of rows?
    If not, post just that one sub-query, your sample data, and the output you need (but are not getting) from that sub-query.
    If it does work, then un-comment the other tables, 1 at a time. Test after each one. If the revised sub-query starts acting strangely, then you have a good clue about what's causing the problem, but if you can't figure it out, post that much of the query, your sample data (CREATE TABLE and INSERT statements) and the expected results from the code you posted.
    If then entire sub-query works, then add the next super-query, and repeat the testing process.
    What is the data type of ibh.pricing_dt?
    If its a DATE, then don't compare it to a VARCHAR2, as you're doing in this line:
    IBH.pricing_dt = '27-FEB-2013'Use TO_DATE to convert a string, such as '27-FEB-2013', to a DATE.
    If it's not a DATE (or TIMESTAMP), then you have an even more serious problem.

  • Modify Primary Key Value while present in child tables

    Hi,
    I have one master table having primary key "ESTNO" and 10 child tables having ESTNO as the part of their primary key / composit key. I need to update the value of ESTNO in a master and associated child tables. what should i do to accomplish this...
    Regards.

    I think the trigger is the best solution to a bad problem. Having just tested it, I can confirm that putting the code in the AFTER UPDATE ... FOR EACH ROW trigger does not require us to make the foreign key deferred (at least in 9.2, I assume that also applies in earlier versions).
    Cheers, APC
    ALTER TABLE t2 ADD CONSTRAINT t2t1_fk FOREIGN KEY (col2) REFERENCES t1(col1)
    SQL> CREATE OR REPLACE TRIGGER "APC_LOAD"."T1_AUR" AFTER
      2  UPDATE ON "APC_LOAD"."T1" FOR EACH ROW BEGIN
      3  IF :NEW.col1 <> :OLD.col1 THEN
      4     UPDATE t2
      5     SET t2.col2 = :new.col1
      6     WHERE t2.col2 = :old.col1;
      7  END IF;
      8* END ;
      9  /
    Trigger created.
    SQL> UPDATE t1 SET col1 = 1 WHERE rownum = 1;
    SQL> SELECT count(*) FROM t1 WHERE col1 = 1;
      COUNT(*)
             1
    SQL> SELECT count(*) FROM t2 WHERE col2= 1;
      COUNT(*)
             1
    SQL>  UPDATE t1 SET col1 = 87979 WHERE col1 = 1;
    1 row updated.
    SQL> SELECT count(*) FROM t2 WHERE col2= 1;
      COUNT(*)
             0
    SQL>
    SQL> SELECT count(*) FROM t2 WHERE col2= 87979;
      COUNT(*)
             1
    SQL>        

  • JDBC adapter to SAP: select & join from multiple tables ???

    Hello,
    I have a task to get an aggregating information from two tables and send it into SAP.
    I use XI JDBC sender adapter to access to MSSQL DB.
    I know how to construct SQL quiery:
    (something like that)
    SELECT  table1.Date  SUM(table1.sum) from table1
    INNER JOIN table2
    ON table1.Number = table2.Number
    But I don't understand how to construct  Data Type for this complex select operator?
    How does it look like?
    Where to store and how to map the selected data?
    Please give me an example or an advice.
    Thank You.

    Hi,
    Use your structure like this.
    <StatementName4>
    <dbTableName action=”SELECT”>
    <table>realDbTableName</table>
    <access>
    <col1/>
    <col2/>
    <col3/>
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName>
    </StatementName4>
    action=SELECT
    Statements with this action cause existing table values to be selected. Therefore, the statement corresponds to an SQL SELECT statement.
    The <access> block contains the column names to be selected, a <key> element contains the columns whose values must be identical with the specified value to get the new column values. The name of the <key> element is arbitrary. Column values within a <key> element are combined with a logical AND; different <key> elements are combined with a logical OR.
    A statement with the action SELECT must have exactly one <access> element. The number of <key> elements with arbitrary names is not restricted.
    The corresponding SQL statement for StatementName4 in the example above is as follows:
    SELECT col1,col2,col3 FROM dbTableName WHERE ((col2=’val2old’ AND col4=’val4’) OR (col2=’val2old2’))
    If there is no <key> element, or if there is a <key> element but it is empty, then no condition is specified and the entire table is to be selected. This may not be permitted by the configuration of the JDBC adapter for security reasons and will therefore result in an error during message processing and an appropriate error message.
    The response document contains the result of the action in XML format as follows:
    <row>
    <column1>value11</column1>
    <column2>value12</column2>
    </row>
    <row>
    <column1>valueN1</column1>
    <column2>valueN2</column2>
    </row>
    This will help you.
    regards
    Aashish Sinha
    PS : reward points if helpful

  • Outer join on multiple tables

    Hi All,
    I need to create multiple outer join in Discoverer.
    My requirements is like this
    I have a report where in I show the sales of components. I have Year as page item in Discoverer cross tab.
    I have 2 years in my year table, 1999 and 2000
    in the components table I have 3 components, X, Y, Z
    In the fact table, I have 5 records as below
    YEAR     PRODUCT     AMOUNT
    1999     X     100
    1999     Y     200
    1999     Z     300
    2000     X     400
    2000     Y     500
    Now with this data, when I create a cross tab with year as page item, I get the following output on selecting 1999 as year in page item,
    component     Amount SUM
    X     $100
    Y     $200
    Z     $300
    similarly when I get report for 2000 it will be as follows
    component     Amount SUM
    X     $400
    Y     $500
    Now I want some way to get a report as below for 2000 and similar cases
    component     Amount SUM
    X     400
    Y     500
    Z     0
    Can some body help me??
    Thanks,

    Hi Mrutyunjay,
    If you keep the query as described by Csaba but leave out time_period.year from the SELECT and GROUP BY list. In addition, replace the SUM(...) function with the following expression.
    SUM (CASE WHEN <condition> THEN fact_tab.amount ELSE 0 END)
    Where <condition> will be along the lines of 'time_period.year = 1999'.
    This will give you the result you require.
    Do be aware that this will force Oracle to do a full scan on the fact_tab table. This may render the solution unworkable.
    Cheers,
    denty.

  • Can VLOOKUP, OFFSET, INDEX and MATCH be used to SUM the value of cells from multiple tables?

    I have a problem thats needs a sulution. I have a Spreadsheet with multiple sheets and tables. The (Truck ) Sheets each represent a "Site" and the tables within from 1-31 show inventory counts for each day of the month.
    Shown below are Edited example's of a "Site" sheet and the Day tables contained within it.
    The Spreadsheet expands as a new "Site" (Truck ) is added regularly. Currently there are 30 "Sites" (Trucks).
    Also within the spreadsheet is a sheet (Checkpoint) which contains tables used to show summary data for each "Site" sheet. There is one table used to review one site, so currently there are 30 tables identical in format and structure reviewing 30 sites.
    An edited example of the summary table for Truck 1 is shown below.
    The table's in CP reference data within cells from other sheets. A LEN INDIRECT formula
    =IF(LEN(INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::K53",addr-style))<1,"",INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::k53",addr-style))
    was used to retrieve the values within certain cells. This formula works perfectly because when I add another "Site" I simply need to Dupicate a "Site" Template Sheet and then Copy Paste the LEN INDIRECT formula in to the newly created Summary table. 
    There is another sheet (Command Central) which contains a Master summary table. The Master Summary sheet is identical in structure to the CP Summary Tables. Its purpose is to show the combined data from the tables within Checkpoint (Truck 1-30). for instance MS::D5=Checkpoint::Truck 1:Truck 30::D5. I realize that Numbers cannot calculate cells within a range of table so I am hoping for a workaround. 
    Could someone please help me with a formula something like the LEN INDIRECT formula mentioned above or possible a something else that could work beside
    D5=Truck 1::D5,Truck 2::D5,Truck 3::D5...?
    When I use that formula type I will have to edit the formula every time I add a new site.
    Anothe issue Im having is getting D3:AH3 to show the correct count of names. I am using the following formula:
    D3=SUM(COUNTA(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3))−SUM(COUNT(UNION.RANGES(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3)))
    The cells it is counting are either blank (the refenced cell contains a LEN INDIRECT formula that places "" if needed) or contain a name. This formula works when I and addressing cells without the LEN INDIRECT formula. What am I doing wrong?

    Hello Wayne,
    Here are screenshots of the tables in question. The first on is the Master summary table.
    Cell D5 shows the value pulled from Checkpoint::Truck 1::D5
    Cell E5 shows the value pulled from Checkpoint::Truck 2::D5
    Cell F5 shows the value pulled from Checkpoint::Truck 3::D5
    Cell G5 shows the value pulled from Checkpoint::Truck 4::D5

  • Intercepting fixed values launching query

    Hi to all,
    I need to intercept where system store single fixed value while launching a query.
    In other words, if i put a single value to an Infoobject in Query Designer, when i launch my query, there is a structure or a table (or other) where i can find this value???
    Tanxs to all!!!!

    Hi Ugo,
    The following may help:
    Table RSZCOMPDIR: Enter the query technical name in COMPID to get the COMPUID.
    Table RSZELTXREF: Put the above COMPUID in SELTUID and put LAYTP as FIX and Version A, to get the TELTUID.
    Table RSZRANGE: Put the above TELTUID in ELTUID. You will get the InfoObject as well as the value it is fixed to.
    Hope this helps...

  • Update row in a table based on join on multiple rows in another table

    I am using SQL Server 2005. I have the following update query which is not working as desired.
    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. But the above update query is considering only one row from
    PlantAction table even though there are multiple rows that match with DocID and PlantID.
    DocHistory column is of type NVARCHAR(MAX).
    How do I fix my query to achieve what I want ? Thanks for the help.

    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    We do not use the old Sybase UPDATE..FROM.. syntax. Google it and learn how it does not work. We do not use the old Sybase CONVERT() string function. You are still writing 1950's COBOL with string dates instead of temeproal data types. 
    You also did not post DDL, so we have to guess about everything. Does your boss make you work without DDL? How do you do it? 
    >> For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction [singular name?] table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. <<
    Why? What does this new data element mean? This is like dividing Thursday by Red and expecting a reasonable answer. Now, non-SQL programmers who are still writing COBOL will violate the tiered architecture rule about doing display formatting in the database.
    If you will follow forum rules, we can help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • What are the Pros and Cons while joining tables at DF and Universe level

    Hi Experts,
    I am new to Data federator designer. I need help on the below.
    Could you please let me know the Pros and Cons while joining the source tables in data federator
    And While joining the DF target tables in universe designer.
    Regards,
    Gana

    Hi,
    1. I have created target tables based on source tables with one to one mapping and then join all target tables in universe.
    Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
    Target tables:Target tables are same as source tables
    --- Yes this is the way to create target Tables  and join them in the universe.These target Tables gives you the flexibility  like in future your requirement is to add one more object based on some calculation which is not possible in the universe so that time you can create  one more column in the target table and do the calculation. at the same time if you are using source table you can not do anything.
    2. Created single target table with all objects of source tables and merged all sources tables data.
    Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
    Target table: Single table.
    --- This is bit complex structure to merge all tables data in the one target table.in this situation you have to put more efforts and it is more complex.basically this type of target table is useful when you are merging data by multiple source into single  or  creating one target table based on the  union of tables by adding two mapping rules or more and you can not join tables in universe.
    Better approach is first 1. create target tables based on the source tables and join them in the universe.
    Thanks,
    Amit

Maybe you are looking for