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

Similar Messages

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

  • Dynamic lookup window

    I understand in R16 there is a Dynamic Lookup window, i.e we can customize the lookup window. can anyone shed some light about this feature.

    I think i got my answer, I can customize it in the Search Lookup window in each object

  • Dynamic lookup of all DB drivers loaded in the system

    Hi everyone
    Actually I want to know that whether it is possible to include in my program, the functionality that allows the dynamic lookup of all the DB drivers in the system.
    I want to list the names of the Database drivers that have been loaded in the system.
    waiting 4 ur reply:)

    I am mailing u the code which I have written, it compiles without any error but does not give the desired output. it does not display even the name of the single driver although I have three loaded drivers in my system.
    By system I mean that in my PC I have previously loaded three drivers by going to the Administrative tools\ODBC Data Sources. I want my program to pick the names of those drivers that have been loaded some time back.
    So,instead of loading those drivers again in my program, I want the program to pick the names of those loaded drivers.
    the code is shown below:
    try
         Enumeration enumm=DriverManager.getDrivers();
         while(enumm.hasMoreElements())
         System.out.println(enumm.nextElement().toString());
    catch(Exception e)
         System.out.println("Error");
    }

  • Using Dynamic SQL in OWB maps

    Hi,
    Is there any way that we can write dynamic SQL in OWB.As per my requirement i want to change the where clauses dynamically on need basis.
    Thx

    David,
    I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
    Thx

  • Service Registry's Dynamic Lookup of BPEL Partner Link not working

    Hi,
    Software : SOA 10.1.3.1
    OS : Windows XP, 2000
    I have deployed webservice application (GetMaxOfTwo) which will give me max of 2 values. Registered the WS in OWSM with user authentication. Registered newly generated WSDL in OSR (Oracle Service Registry). A simple BPEL Process will call service as PartnerLink, which is configured as "Enabling Dynamic Lookup of BPEL Partner Link Endpoints". As mentioned in the document made entry in bpel.xml as registryServiceKey property containing the serviceKey value to the partnerLinkBinding section.
    The entire scenario is working fine and changed the servicekey value to wrong value in bpel.xml and redeployed, as expected it was giving me error message saying invalid servicekey.
    Now deployed GetMaxOfTwo in another application server and registered in OWSM. Intentionally stopped the first GetMaxOfTwo application. In the OSR Service changed the binding with new WSDL of OWSM. As BPEL process enabled with dynamic lookup it should execute without any error. But the results in this case was giving error saying the service was down. (Means it is referring to the old GetMaxOfTwo webservice.
    What could be the reason?, something is missing in the configuration?
    Regards
    Venkata M Rao
    +91 80 4107 5437

    Hi
    I am having trouble making the BPEL and Systinet to work together. I have Systinet and BPEL installed separately on 2 different servers. I deployed my web services and registered them in UDDI. I created a new BPEL process and added a partner link to refer to one of the web service I have registered in UDDI. When I create the partner link, it is forcing me to give the wsdl and it also gives an error message " There are no partner link types defined in current wsdl. Do you want create that will by default create partner link type for you?". If I say "NO' then deployment fails. If I say "Yes", then it creates a new wsdl file on the local server etc and gives "<Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 75164a0815ea471a:-3be8c246:117cc377894:-537b. Please check the process instance for detail.</faultstring>". Any help is appreciated.

  • Getting dynamic lookup error!

    I am using OSX 10.9.5 and getting the below error:
    dyld: lazy symbol binding failed: Symbol not found: _OCIEnvCreate
      Referenced from: /Users/Desktop/socket.io/node_modules/node-oracledb/build/Release/oracledb.node
      Expected in: dynamic lookup
    dyld: Symbol not found: _OCIEnvCreate
      Referenced from: /Users/Desktop/socket.io/node_modules/node-oracledb/build/Release/oracledb.node
      Expected in: dynamic lookup
    Any ideas? This pops up on the require statement itself :
    var oracledb = require('node-oracledb');

    Have you set DYLD_LIBRARY_PATH?  See http://www-content.oracle.com/technetwork/topics/intel-macsoft-096467.html#ic_osx_inst

  • Dynamic lookup

    Hi All,
    I want to know how to implement Lookup Dynamically in ODI, I know the concept of normal lookup.
    But here in my case I have to lookup the same table many times
    My Environment :
    Oracle 10g, ODI 11g, Windows 2003
    Thanks in Advance
    Regards,
    RR

    You can pull the lookup table..any number of times into your source part of interface. I Have done that a couple of times..i had a requirement where i had to join table a to several tables with different join conditions and filters..Hope that helps..
    Thanks
    Venkat

  • Dynamic lookup using UDDI inside of BPEL

    Currently I'm looking into using UDDI as a solution to finding web services for BPEL, as opposed to simply keeping static WSDLs around. Initially I would just like to know if it is possible to do a lookup to a UDDI server inside of BPEL, and then invoke a service returned by the lookup.
    The ideal solution we are looking for is to keep a local WSDL to one of the web services we would like to call. We would first attempt to call this web service... but on the event of a failure (such as the service being down), we could go to UDDI to find another instance of this service that is up and running.
    This leaves a lot of questions though... how possible is it for BPEL to work dynamically in the first place? MUST I specify the location of the Web Service at compile time? Is it possible to keep a local directory with WSDLs in it, and have BPEL parse them at run time (meaning, I could invoke some function inside of BPEL to parse the WSDL to find the address to the web service)?
    Is this solution even remotely do-able?
    The other solution which seemed more feasible would be to create a proxy service, which basically mimics the input/output behavior of the original web service I want to invoke, but in reality is using UDDI to find the real web service, and forward the results to/from it.
    I'm wondering why UDDI is generally so overlooked. It seems like it's a buzzword to get into your product, but nobody anywhere seems to make any actual usage out of it. It seems like a pretty important idea behind the SOA structure.

    I think the challenge is in figuring out when to do the request for search to the backend. If you have fast turnaround time, you can probably send a new request each time the user types a character and bring back the results for it as they type - that may be overkill though. if this is the way you do it, then your filtering is done before it returns from the server. For performance reasons, you may wish to use a stored procedure in the database that does a regular expression search on your data ( only search the columns you have to.)
    As for getting the data back: In the result handler, the function you specify [in the remote method call] to load the returned data into the local dataprovider, you could simply have it clear the dataprovider re-populate it and call refresh() on the dataprovider each time. I am not sure how that would appear to the user as it again depends on turnaround time from the backend, size of the dataset, etc.
    I hope this gives you an idea at least. Without knowing more about your application and how it is architected, it is difficult to provide any "reasonable" recommendation. It is an interresting problem and one that sounds like fun to solve - of course, I am not sitting there with management breathing down my neck either.

  • 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

  • Using a dynamic lookup table

    Hi,
    Simple question for the ODI guru's.. for an interface that we use, there is a requirement to dynamically look-up value's in a lookup table and then use these value's from the lookup table to write to a target table.
    This instead of hard coding string value's in the target table of the interface.
    ODI (11g) gives the option to use a lookup table, but it kind of assumes a relationship between the lookup table and source table - ie.it nicely allows you specify either an outer join or a subquery in the select statement.
    In this case, using the lookup, there is none however - no relationship between either lookup and source columns. So how would you do this?
    An outer join could be used, but then it requires to specify a join on columns of the source and lookup tables, so you could use dummy columns, but that is not ideal as columns might actually match. Any ideas?
    Cheers

    If there is no relationship between the values in your source table and those in the lookup table I can't see how you expect to perform a lookup - without a relationship it would be guesswork. For your requirements you would have to define a link table which held the associations between the 2 tables.

  • Dynamic Lookups in OIM 11gR2

    Hi,
    Is it possible to have dynamic look up . Seems lookup query is no more supported.
    any pointer will be helpful.
    thanks in advance.

    http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABFFACA
    http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABFFACA

  • Dynamic Lookup Type Codes in a Message

    Hi there,
    I have the following requirement and I do not know if it is possible to do it or not. Advices, help and suggestions are more than welcome.
    Here is the my problem:
    I have a notification/message that has a respond item linked to a Lookup Type. I would like to change the Description of the lookup type codes depending on a value store in a table. I was looking for some sort of PKG/Procedure to do so but I could not find.
    Is there a way to achieve it without duplicating the notification (linking to the different Lookup Type/Codes)?

    Hi,
    I've answered your duplicate post on the WorkflowFAQ forum at http://smforum.workflowfaq.com/index.php?topic=783.0
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

Maybe you are looking for

  • Messages still stuck in the Inbound queue SMQ2

    Hello XI Gurus, All my messages with "READY" status are still stuck in the inbound queue (smq2) for the last 2 hours...there was no SYSFAIL error messages or scheduled background running. I have to manually go in and executed each of those messages,

  • Airport Express as wireless repeater

    Hi all, just wondering if anyone could give me a hand. I have just bought an Airport Express (not arrived just yet) not just for streaming music, but for extending my network. I am a student and have just moved into my new house. The internet here al

  • What is the best replacement for iWeb?

    I have been using iWeb for a very long time. I need to move on to something that is being updated. What is the best replacement for iWeb? I see Wordpress needs special software to work on a Mac. Thanks! Pat

  • Problem in FOR ALL ENTRIES IN statement

    Hi Abaper, I have a problem in FOR ALL ENTRIES IN statement. I have a table /ccsht/na_estadi in this table for the particulat date there are 14 records, but my internal table read only 5 record. Below is my code: SELECT sociedad          xhotel_id   

  • How do I get my plugins to work in PS CC2014?

    How do I get my plugins to work in PS CC 2014?