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

Similar Messages

  • How to implement dynamic sql in owb

    Hi everybody,
    I am new to OWB and hence i want to know how i can implement the following dynamic sql statement in owb...
    Declare
    Cursor C_tab_col is
    Select cat from tbl_cat_edesc_1 ;
    Vcat varchar2(240);
    Cursor C_edesc_col is
    Select edesc from tbl_cat_edesc_1 ;
    Vedesc varchar2(240);
    V_Command varchar2(30000);
    Begin
    Open C_Tab_col;
    Fetch C_tab_col into vcat;
    Open C_edesc_col;
    Fetch C_edesc_col into vedesc;
    loop
    V_Command := 'update upd_catseg_1 c set c.'||vcat||'=';
    V_Command := V_Command||'(select d.sales from TEST_catseg d' ;
    V_Command := V_Command||' where edesc = '||''''||vedesc||''''||' and c.cardno=d.cardno)';
    dbms_output.put_line('10 '||V_command);
    Execute immediate v_command;
    Fetch C_tab_col into vcat;
    Exit when c_tab_col%notfound;
    Fetch C_edesc_col into vedesc;
    Exit when c_edesc_col%notfound;
    end loop;
    commit;
    end;
    Thanks a many

    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

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

  • 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

  • How to implement checkpoint restart in OWB 11gR2?

    How to implement checkpoint restart in OWB 11gR2?
    Which will enable us to restart the OWB mapping from the last successfully inserted checkpoint onwards.
    Edited by: user4593813 on Jul 6, 2010 10:23 AM

    Hi Borkur,
    Thanks for reply.
    Actually I want to implement it in OWB. But after I got the answer from you, I decided to do in some othere way.
    The way you mentioned is right when we are performing the operations directly on a table.
    But in my scenario, an intermediate data is generating. I want to perform lag over operation on those records. Its possible by view.
    So for performing operations for intermediate result, Oracle is providing Table Function concept. I can pass the result to it.
    But the problem again is, how to implement the lag over operation there.
    Any idea.?
    Thanks and regards
    Gowtham sen.

  • How to implement Lag over  in OWB?

    Hi,
    Could any one please explain, how we can implement lag over in OWB?
    Thanks and regards
    Gowtham Sen.

    Hi Borkur,
    Thanks for reply.
    Actually I want to implement it in OWB. But after I got the answer from you, I decided to do in some othere way.
    The way you mentioned is right when we are performing the operations directly on a table.
    But in my scenario, an intermediate data is generating. I want to perform lag over operation on those records. Its possible by view.
    So for performing operations for intermediate result, Oracle is providing Table Function concept. I can pass the result to it.
    But the problem again is, how to implement the lag over operation there.
    Any idea.?
    Thanks and regards
    Gowtham sen.

  • How to Implement Dynamic Modification Rule for Material & multiple vendor Combination

    Hi Team,
         In dynamic modification rule for Material &  vendor combination, i have maintained material & vendor in Inspection plan at Material Assignments
    1.If i purchase same material from different vendors then how to implement ?

    Hi Balaji,
    I am not sure if i have followed your requirement.
    What do you want to do with Vendor Z? Do you want to inspect each lot from Z?
    If yes:
    Then Create 2 Inspection plans with same Operations and Same MICs, In Material Assignment, mention Vendor as Z so that 1st inspection plan will only be for Vendor Z. Do not enter DMR in Header.
    In 2nd inspection plan Enter DMR and do not mention any vendor so this plan will be applicable for all vendors except Z.
    If No:
    Then create Qm info record for vendor Z with "No inspection" set in QI06.
    Amol.

  • How to implement Dynamic Context Node Mapping between Components

    Hey genuis:
               I am looking for how to implement context mapping bwteen two components. I read some threads, and try to use external context mapping. The example works fine. However, my requirement is more than that.
    I have a context node in Component B, and the attributes in it are dynamically generated. Component A is the main component which use Component B's function. Both A and B work fine by theirselves. 
    When I assemble A and B (external mapping), the system gives me a exception:com.sap.tc.webdynpro.progmodel.context.ContextException: MappedNodeInfo(T8UploadCompInterface.data): cannot create nodes, no mapping defined yet.
    Please give me some suggestion?
    Any responses are appreciated.

    I miss this thread.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6fdae690-0201-0010-a580-d104b459cb44
    This is almost the right solution for my problem.

  • How to implement Dynamic SQL in DataService ??

    Hi,
    Is there any way in ALDSP to implement Dynamic SQL in Dataservice ?
    My scenario is "based on set of optional fields i need to join different tables.If the optional field is not there then i don't have to join with the corresponding table."
    Thanks

    Ah yes, I thought that looked familiar. It's same question from July 12.
    There is no way to generate Dynamic SQL in DSP XQuery. There is one query plan for each query. The query plan does not change based on the inputs.
    Using a FilterXQuery on top of a query actually generates a new query. You can play with that if you like, but it is not particularly suited to changing joins. Go with the ad hoc query.

  • How to implement scd1,scd2 in OWB

    Hi,
    i want to implement scd1,2 using OWB earlier i am working on informatica i am new to OWB pls guide me

    check this
    http://www.rittmanmead.com/2006/09/working-through-some-scd-2-and-3-examples-using-owb10gr2/

  • How to implement Dynamic form validation

    Hello,
    I've been reading up on the forums about using the htmldb.item package to dynamically create form elements using a SQL query. Assuming I can generate the form dynamically, what approaches/options are available for implementing dynamic validation of the form elements themselves?
    Thanks in advance

    You could write a page-level 'PL/SQL Function Body returning error text' validation where you loop over your dynamic form elements (htmldb_application.g_fnn), check the values and raise errors as needed.

  • How to implement Dynamic Sort to an SQL classic report?

    Hi,
    I'm trying to implement dynamic sort to my working sql classic report, when user selects order by column from select item(action as submit page), the report should be refreshed and display with the selected column sort order.
    But not able to do so.
    Report Query:
    Select a, b, c from sample order by :P1_ORDER_BY
    P1_ORDER_BY - Select Item:
    STATIC2: Column 1;a, Column 2;b, Column 3;c
    Running page, report doesnt sorts in any of the column priority.
    Kindly guide.
    Regards,
    Krishna

    Of course the select item is in use.
    It should submit the the page on select so you can retrieve the current value in you report select statement.
    look here:
    http://apex.oracle.com/pls/apex/f?p=21296:2:
    table:
    create table sample
      a varchar2(30)
    , b varchar2(30)
    , c varchar2(30)
    insert into sample values('a','z','k');
    insert into sample values('b','y','d');
    insert into sample values('c','x','a');
    insert into sample values('d','w','b');
    commit;
    Select List:
    P2_ORDER_BY
    STATIC:Order by A;A,Order by B;B,Order by C;C
    Report select:
    select
    a,b,c
    from sample
    order by
      decode(:P2_ORDER_BY,'A',a,null)
    , decode(:P2_ORDER_BY,'B',b,null)
    , decode(:P2_ORDER_BY,'C',c,null)Marc
    Edited by: telemat on Aug 24, 2012 1:50 PM

  • 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

  • How to Implement Dimension Operator in OWB

    Hi,
    Actually I am new to OWB and I am confused about the use of dimension operator and cube operator
    I want to know how data is mapped with dimension operator as source and target(in different cases) and also how the cube operator is attached to the dimension operator..
    Bottom line is what is the use of dimension operator and cube operator in mapping.
    Please help me out with this..its urgent
    Thank you
    Edited by: rishiraj on Jan 3, 2012 11:10 PM

    The dimension and cube operator encapsulate a lot of standard ETL for loading dimension and cubes (semantics on top of implementing tables). For example the operators handle hierarchy loading, surrogate key management, slowly changing dimensions, late arriving facts and all sorts. In many tools this kind of behavior has to be manually developed by users.
    You can expand the dimension operator and see under the hood to look at the code that is produced.
    Cheers
    David

  • How to implement dynamic form?

    Hi, all
    Currently, I am using XPAAJ to merge xml data sent from Flex side and the pdf template in the server side which is designed by LiveCycle Designer.
    But now my question is that my form is dynamic, like the rows of table. How could I implement such kind of functionality?
    Thanks
    Alan Ji

    And actually, the exact requirement is that user should enter values in Flex pages and click "View as PDF", data will be sent back to merge with PDF template.
    Under this situation, how could the form be dynamic?
    Thanks for any help.

Maybe you are looking for