How do you do Dynamic Lookup in OWB?

Hi,
Is there a way to lookup records that have been processed but not yet committed in the db?
I have a data set that contains records that need to be inserted and updated. Some records in the data set have entries for both insert & updated i.e. the same record is inserted and updated in the data set. How could I determine if the record has been processed (inserted but not yet committed in the db)?
Thanks.
-bzx

Hi Nawneet,
Here is an example:
Let's say, the external table has the structure as follow:
company_id, company_name, company_url, address_line, city, state, country, last_changed_on
I have 2 tables:
COMPANY_TABLE, which has the following structure
company_id, company_name, company_url, last_changed_on
and ADDRESS_TABLE, which has the following structure
address_line, city, state, country, last_changed_on
Now, let's say I have the following 2 records in a source dataset (external table):
20, XYZ company, www.xyzcompany.com, 4500 longpond road, victor, ny, usa, oct 10, 1990
22, ABC company, www.abccompany.com, 4500 longpond road, victor, ny, usa, jan 11, 2010
I would like to add the above records as follow:
COMPANY_TABLE:
20, XYZ company, www.xyzcompany.com, oct 10, 1990
22, ABC company, www.abccompany.com, jan 11, 2010
ADDRESS_TABLE:
4500 longpond road, victor, ny, usa, jan 11, 2010
That is, the ADDRESS_TABLE should not add duplicate entry. We use address_line, city, state, & country columns to determine if the record already exist.
So, what I am expecting from the mapping is that it should first "insert" the following record:
4500 longpond road, victor, ny, usa, oct 10, 1990
and then "update" it later when it gets the next record:
4500 longpond road, victor, ny, usa, jan 11, 2010
I am using lookup operator on the ADDRESS_TABLE to determine if the address already exist but it only works if the 1st record has already been committed (i.e. in the table).
Thank you.
-bzx

Similar Messages

  • Dynamic Lookup in OWB 10.1g

    Can we execute dynamic lookup in OWB 10.1g?
    I want update the columns of the target table, based on the previous values of the columns.
    Suppose there is a record in the target table with previous status and current status columns.
    The source table consist of 10 records which need to be processed one at a time in a single batch. Now we need to compare the status of record with the current status of target table. If the source contains next higher status then the current status of target record need to go to previous status and the new status coming from source need to overwrite the current status of target record.
    We have tried using row based option as well as setting commit frequency equal to 1 but we are not able to get the required result.
    how can we implement this in OWB10.1g?

    OK, now what I would do in an odd case like this is to look at the desired FINAL result of a run rather than worry so much about the intermediate steps.
    Based on your statement of the status incrementing upward, and only upward, your logic can actually be distilled down to the following:
    At the end of the load, the current status for a given primary key is the maximum status, and the previous status will be the second highest status. All the intermediate status values are transitional status values that have no real bearing on the desired final result.
    So, let's try a simple prototype:
    --drop table mb_tmp_src; /* SOURCE TABLE */
    --drop table mb_tmp_tgt; /*TARGET TABLE */
    create table mb_tmp_src (pk number, val number);
    insert into mb_tmp_src (pk, val) values (1,1);
    insert into mb_tmp_src (pk, val) values (1,2);
    insert into mb_tmp_src (pk, val) values (1,3);
    insert into mb_tmp_src (pk, val) values (2,2);
    insert into mb_tmp_src (pk, val) values (2,3);
    insert into mb_tmp_src (pk, val) values (3,1);
    insert into mb_tmp_src (pk, val) values (4,1);
    insert into mb_tmp_src (pk, val) values (4,3);
    insert into mb_tmp_src (pk, val) values (4,4);
    insert into mb_tmp_src (pk, val) values (4,5);
    insert into mb_tmp_src (pk, val) values (4,6);
    insert into mb_tmp_src (pk, val) values (5,5);
    commit;
    create table mb_tmp_tgt (pk number, val number, prv_val number);
    insert into mb_tmp_tgt (pk, val, prv_val) values (2,1,null);
    insert into mb_tmp_tgt (pk, val, prv_val) values (5,4,2);
    commit;
    -- for PK=1 we will want a current status of 3, prev =2
    -- for PK=2 we will want a current status of 3, prev =2
    -- for PK=3 we will want a current status of 1, prev = null
    -- for PK=4 we will want a current status of 6, prev = 5
    -- for PK=5 we will want a current status of 5, prev = 4
    Now, lets's create a pure SQL query that gives us this result:
    select pk, val, lastval
    from
    select pk,
    val,
    max(val) over (partition by pk) maxval,
    lag(val) over (partition by pk order by val ) lastval
    from (
    select pk, val
    from mb_tmp_src mts
    union
    select pk, val
    from mb_tmp_tgt mtt
    where val = maxval
    (NOTE: UNION, not UNION ALL to avoid multiples where tgt = src, and would want a distinct in the union if multiple instances of same value can occur in source table too)
    OK, now I'm not at my work right now, but you can see how unioning (SET operator) the target with the source, passing the union through an expression to get the analytics, and then through a filter to get the final rows before updating the target table will get you what you want. And the bonus is that you don't have to commit per row. If you can get OWB to generate this sort of statement, then it can go set-based.
    EDIT: And if you can't figure out how to get OWB to generate thisentirely within the mapping editor, then use it to create a view from the main subquery with the analytics, and then use that as the source in your mapping.
    If your problem was time-based where the code values could go up or down, then you would do pretty much the same thing except you want to grab the last change and have that become the current value in your dimension. The only time you would care about the intermediate values is if you were coding for a type 2 SCD, in which case you would need to track all the changes.
    Hope this helps.
    Mike
    Edited by: zeppo on Oct 25, 2008 10:46 AM

  • Dynamic lookup in OWB

    Hello All,
    Is there any dynamic lookup in OWB, if so, please let me know how to implement the same OWB.
    awaiting for your reply......

    Hello All,
    Is there any dynamic lookup in OWB, if so, please let me know how to implement the same OWB.
    awaiting for your reply......

  • How to implement Dynamic lookup in OWB mappings(10g)

    Hi,
    Iam using OWB 10g version for developing the mappings.
    Now I need to implement the Dynamic lookup in the mapping.Is there any transformations available in OWB to achieve this.
    Please give me some information about the same.
    Thanks in advance...

    Hi,
    first i have created a procedure witht he following code in the code editor...
    BEGIN
    Declare
    Cursor C_brand_col is
    Select cat from TBL_CAT_EDESC_BRAND ;
    Vbrand varchar2(240);
    Cursor C_bredesc_col is
    Select EDESC_BRAND from TBL_CAT_EDESC_BRAND;
    Vbredesc varchar2(240);
    V_Command varchar2(30000);
    Begin
    Open C_brand_col;
    Fetch C_brand_col into vbrand;
    Open C_bredesc_col;
    Fetch C_bredesc_col into vbredesc;
    loop
    V_Command := 'update sav_fc_sa_pc c set c.'||vbrand||'=';
    V_Command := V_Command||'(select d.fc_brands_sa from TEST_brand d' ;
    V_Command := V_Command||' where d.brand_edesc = '||''''||vbredesc||''''||' and c.cardno=d.cardno)';
    dbms_output.put_line('10 '||V_command);
    Execute immediate v_command;
    Fetch C_brand_col into vbrand;
    Exit when c_brand_col%notfound;
    Fetch C_bredesc_col into vbredesc;
    Exit when c_bredesc_col%notfound;
    end loop;
    commit;
    end;
    END;
    then i validate it and deply it..
    after that i create a mapping and in that mapping i first import the table TBL_CAT_EDESC_BRAND and drag and drop it into the mapping and again the i put the procedure into a transformation operator and connect the inoutgrp of the table to the transformation operator ingrp deploy it and run it...this is taking a lot of time .... so i am not sure whether i am doing the right thing...for this dynamic sql i dont need to pass any parameters. can i juz execute this procedure or should i create a mapping ???? i am totally confused... could you please help me.....how to proceed........
    if i juz execute the dynamic sql it takes only 5 min in sql but i am not sure how ti implement it in owb... can you please help...
    Thanks a many

  • How do you save dynamic data type, from the DAQ assistant, for use in Excel or matlab?

    Currently, I have the following basic VI setup to save Data from my PCI6221 Data Aquisition Card.  The problem I'm having is I keep getting the last iteration of the while loop in the measurement file and that's pretty much it.  When I try to index the data leaving the loop it gives me a 2D array of Data which cannot be input into the "Write to Measurement File" VI.  How would I save this to a useful Data/time step format?  I was wondering of a way to continuously collect the Data and then save it in a large measurement file that I would manipulate in Matlab/excel?  Am I using the wrong type of loop for this application?  I also noticed my Dynamic Data array consists of data, time, timestep and then a vector of the data taken.  Is it possible to just get a vector of the time change per sample alongside the data?    Sorry for the barrage of questions but any help would be greatly appreciated, and thanks in advance!
    -Bryan
    Attachments:
    basic DAQ.vi ‏120 KB

    There is a VI in the Express > Signal Manipulation palette called "From DDT" that lets you convert from the Dynamic Data Type to other data types that are more compatible with operations like File I/O....for instance, you could convert your DDT into a 2D array and use the Write To Spreadsheet File.vi.  Just a thought...
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How do you call dynamic fields in Report Builder

    I have some fields that they were filled in a dynamic way,
    and I want to make some calculations using the information that was
    populated in this field. When I put the name of the field in my
    calculation control, it did not see find the field control.
    Does anyone know how can I call the field control? The
    information is not part of any particular column of the
    query.

    check out the Oracle Portal Tutorial White Paper (http://technet.oracle.com/docs/products/iportal/listing.htm#tutcase), there is a section where they build a report with repeating fields

  • TS1398 How do you rectify "DNS lookup failed" on an iPad?

    I cannot access certain web sites and get the above message.  I have managed to find instructions on how to fix the problem for a Windows based PC but not an iPad.
    Can anyone help?  I am not technically minded.  We have a BT home hub wireless router.

    Hi makc1!
    Here is an article for you that talks about DNS settings and can help you troubleshoot this issue:
    Non-responsive DNS server or invalid DNS configuration can cause long delay before webpages load
    http://support.apple.com/kb/ts2296
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • How do you size dynamically loaded images?

    Hi,
    I am loading images from mysql into flash using php, I need
    to make thumbnails out of these images, so they need to be resized
    as they are loaded in and then displayed to one set size. Does
    anyone have any ideas?
    thanks
    Gavin

    Jan-Paul K>
    i thought it was _xscale & _yscale?
    thahip>
    if what you need is "one set size", then use _width &
    _height.

  • How to iterate  xml dynamically using pl/sql

    Example :--
    example data will be stored in one column using clob.
    <?xml version="1.0"?>
    <PO pono="2">
    <PNAME>Po_2</PNAME>
    <CUSTNAME>Nance</CUSTNAME>
    <SHIPADDR>
    <STREET>2 Avocet Drive</STREET>
    <CITY>Redwood Shores</CITY>
    <STATE>CA</STATE>
    </SHIPADDR>
    </PO>
    HOw will you get dynamically for shipaddr
    2 Avocet Drive
    Redwood Shores
    CA
    With Regards,
    L.Rajesh
    Edited by: LRAJESH on Aug 30, 2010 9:52 AM

    You mentioned plsql...so here is an example iterating over POs:
    begin
    for rec in (with q as(select xmltype('<?xml version="1.0"?>
                                           <PO_LIST>
                                            <PO pono="2">
                                             <PNAME>Po_2</PNAME>
                                             <CUSTNAME>Nance</CUSTNAME>
                                             <SHIPADDR>
                                              <STREET>2 Avocet Drive</STREET>
                                              <CITY>Redwood Shores</CITY>
                                              <STATE>CA</STATE>
                                             </SHIPADDR>
                                            </PO>
                                            <PO pono="3">
                                             <PNAME>Po_3</PNAME>
                                             <CUSTNAME>Smith</CUSTNAME>
                                             <SHIPADDR>
                                              <STREET>5 West Drive</STREET>
                                              <CITY>San Francisco</CITY>
                                              <STATE>CA</STATE>
                                             </SHIPADDR>
                                            </PO>
                                           </PO_LIST>') the_xml from dual)  
                 select x.street, x.city, x.state
                   from q,  --your table here
                        XMLTable(
                         'PO_LIST/PO/SHIPADDR'   --note I have wrapped POs in a PO_LIST tag
                         passing q.the_xml  --your clob here
                         columns
                          street varchar2(1000) path 'STREET',
                          city varchar2(1000) path 'CITY',
                          state varchar2(1000) path 'STATE'
                        ) x)
      loop
       dbms_output.put_line(rec.street||' -- '||rec.city||' -- '||rec.state);
    end loop;
    end;Edited by: dmars on Aug 30, 2010 1:39 PM

  • How do you dynamically check if all member children are missing?

    Hi All,
    How do you dynamically check if all member children are missing?
    e.g. the below line does not work because you cannot directly use member sets in an IF statement.
    IF ((@CHILDREN ("Profit")==#MISSING))
    If I explicitly list all children in the IF statement, it will work, but there is alot of hardcoding.
    Thanks in advance.
    Darren

    Hi All,
    We have a BSO app and we need to query the account without aggregating the data..
    We have 4 accounts sitting under Profit:
    Profit
         A001
         A002
         A003
         A004
    @SUM (@DESCENDANTS ("Profit")) works fine, but we also need to sum the accounts for the parent member of the current business that is evaluated, I have tried @SUM (@DESCENDANTS ("Profit")->@PARENT ("Business")) but this does not work.
    This however works...
    @SUM(
    @PARENTVAL("Business","A001"),
    @PARENTVAL("Business","A002"),
    @PARENTVAL("Business","A003"),
    @PARENTVAL("Business","A004"))
    Is there a dynamic method to add the parent values together?
    Cheers,

  • 5.1 SP10 How do you programmatically make a datasource from a dynamically created Pool?

    How do you programmatically make a data source from a dynamically created Pool?
    I can make the Pool OK but can not find any classes the return a datasource
    given a JDBC Pool.
    Thanks in advance

    Hi John,
    weblogic 5.1 doesn't have API allowing dynamic creation
    of datasources. 6.1 does.
    Regards,
    Slava Imeshev
    How do you programmatically make a data source from a dynamically createdPool?
    >
    I can make the Pool OK but can not find any classes the return adatasource
    given a JDBC Pool.
    Thanks in advance

  • In EPM10, how do you call/reference a dynamic range from a macro.

    Hi Gurus
    In EPM10, [we are using SP16,P1], how do you call/reference a dynamic range from a macro.
    EG, in the BPC input sheet below, we have BPC reports ‘000’,’001’,’002’. For report ‘001’,users are able to select from diffent versions which each have different number of months. In the forecast version below, there are 7 months. We require a macro to select & delete f'cast data content of report ‘002’, there after we will manipulate it via the macro and return it. However, standard excel named ranges don’t work per BPC7.x and don’t dynamically expand.
    The macro code in 7.x was:
    Range(“REPORT1_RANGE”).Select >> Does any oneknow the replacement in EPM10 please?

    The following macro which accesses API's looks like it would help to define the report range:
    Sub TopLeftCell()
    Range("c26").Select
    Application.Run "EPMExecuteAPI", "GetDataTopLeftCell", "", "Sales Planning", "001"
    End Sub
    Anybody able to assist with the syntax of this macro..it currently runs without error, however does not return any result?? Note:
    * the parameter ''" relates to the text which i believe can be left if using macros
    *the parameter "Sales Planning" is my worksheet name
    *the parameter "001" is my report definition.
    I was hoping to return the result back to cell C26. Thanks All

  • How do you generate a dynamic prompt in BO

    Hi,
    can anyone answer this question?
    How do you generate a dynamic prompt?

    Hi,
    Dynamic prompt means user can enter value  at run time (Report Refresh Time).
    You can create dynamic prompt by drag one object in the webi query filter part  and select as a prompt.
    or on the universe level define the pre-defined condition and use that in the webi report.
    Thanks,
    Amit

  • How do you create a dynamic playlist?

    I want a playlist for my videos, preferably with thumbnails like the flash player Adobe offered with Popeye sample/test videos. How do you configure the player for that? I believe it's by Kaltura, and their website shows that feature but I can't find it mentioned in the documentation. Thanks!

    Hi mfuller52654,
    Currently in Strobe MediaPlayback we have support for:
    - simple playlists (m3u format): no thumbnails or title, example in http://osmf.org/dev/1.5gm/StrobeMediaPlayback.html?src=playlists/playlist.m3u
    - JS playlists, without autoadvance - a sample can be found at http://osmf.org/dev/1.5gm/jsdemo.html
    I think the second option can help you create your thunbnailed playlists.
    Tell me if this helped,
    S.

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

Maybe you are looking for

  • Unable to configure SSO in Oracle11g

    Hi, I have tried to install and Configure SSO in Windows 2008 R2 server (64bit). I am facing issue with SSO Metadata repository installaion, please helpful on that. Steps I did 1. Installed Oracle 11g R2 2. Installed Oracle WebLogic Server (10.3.3) 3

  • How to know a variable is accessed ??

    Hi all, I have two Java Classes as follows : public class A { public int a =5; and -- public class B { public static void main(String[] args) { System.out.println(new A().a); Now i want to generate a log file (when the execution of main() method of c

  • I Might Drive you guys nuts today!

    Ok guys heres another problem i can't figure out. After compiling my code it runs well, but my teacher said i need to use teh number format class to 2 decimal places and when i write that in my code it gives an error saying cannot find symbol. Ill po

  • Which is the Simplest E-Business Suite.

    Hi All, I was going through the E-Business suite 12, There are so many components. I just wanted to know which is the simplest E-Business Component in the suite that can be easily installed and configured. With installation guide or admin guide if an

  • Idea of conversion xml to sql

    Hi, I'm a student I need to write a java program, which can convert any XML file to SQL database (i.e. MySQL, Postgres). BUT I don't have any idea, how to do that. Because XML files can be quite complex: i.e: <a>       <b>               <c>