Comparing two data sets in BPEL

Hey guys,
There exists a web service that provides (and is the source of) data and a table that is independent of the service that holds the same data. I'm writing a BPEL 11g process to sync the data that is returned from the service with the data in the table. I invoke the service and database adapter to receive a collection of the data and I need to compare the two data sets to see what's in the service's data set that isn't in the table's data set, so that I can insert them into the table. I also need to compare the values of the data sets for possible updates to already existent records. I'm not sure how to do this though. I was thinking of using an embedded java activity to compare the two sets. What's the best way to do this? Code examples would be much appreciated.
Thanks,
Bill

Hi Bill,
How many records are we talking about here? BPEL may not be the best option for synchronisation of large data sets... Probably ODI would be more suitable...
S.Ananth's solution is probably the simple and neat way to solve your case... would this operation BLINDLY update all records? Short answer: no
Long answer... Merge first reads the corresponding records in the database, calculates any changes, and then performs a minimal update. INSERT, UPDATE, and MERGE make the most sense when you are thinking about a single row and a single table. However, your XML can contain complex types and map to multiple rows on multiple tables. Imagine a DEPT with many EMPS, each with an ADDRESS. In this case, you must calculate which of possibly many rows have changed and which to insert, update, or delete. If a specific row did not change or only one field changed, then the DML calls is minimal.
About merge on DBAdapter...
http://docs.oracle.com/cd/E28280_01/integration.1111/e10231/adptr_db.htm#BDCDBAJI
Cheers,
Vlad

Similar Messages

  • Compare Two Date - Very Urgent

    hi to all,
    i want to compare two date..
    i m getting one date from database and having current date..
    what my issue is i want to dispaly error message when database date greater
    than current date value..
    pls help to my problem...

    import java.util.*;
    public class DateVlid {
         public static void main(String[] args)throws ParseException {
              Calendar currentDate=Calendar.getInstance();
              Calendar dbDate=Calendar.getInstance();
              dbDate.set(2007,12,10);
              boolean b=currentDate.before(dbDate);
              if(b){
                   System.out.println("it is before date");
    }Try it once for a while.
    If it has any problems let me know.

  • Parts of the Data went missing when linking two data sets

    Hello Everyone!
    I have two data sets for my report:
    1. an essbase cube which is transformed to a relational star shema transformed by BI Administraion, Im calling the cube with sql (not mdx)
    2. a single relational table
    In the report Im iterating on the 'product' dimension of the cube and I need to join the cube with the single relational table, because that table holds all the detailed information on each product (mostly text therefore it is not in the cube).
    What I did was, joined the two data sets with a Master/Detail link. So far so good. But the thing is, more than half of my data goes missing in the xml-Output when I join those too. If I delete the join, all the data is back again in the xml-ouptut but I cant refer to the details of the relational table.
    I tried different things to fix that problem. So I sorted the 1. dataset and joined it again with the 2. dataset. As a result there was still a lot of data missing, but not the same as before.
    I find this behaviour really strange and don't have a clue what to do differently.
    I would really appreciate some help, because I already spent hours trying to fix that problem.
    Thank you!
    Edited by: 981323 on 27.02.2013 06:49

    Thanks for that. Typically I found this 5 minutes after I posted the request on the forum.
    Problem is every time I try and do this the system does not recognise my <?for-each> containing the parameter and says the parameter is not defined. WHen I validate the template it seems to ignore the F completely and complains about to many ends.
    I just can't see why it does not work. I am using four records, 2 of each set I am using which link over item number. I can show them seperately but as soon as I add the variable loop ( <?for-each:/INV_GL/GL[GLLITM= $ITM]?> where ITM is my variable and GLITM is that field in the data) it stops working.

  • Compare two dates in a report

    Hi,
    I would like to compare two dates on a report.
    I would like to compare the opportunity created date and the opportunity modified date. I can't use this formula CASE WHEN Opportunity."Last Modified" = Opportunity."Created Date" then 1 else 0
    I think I have to use TIMESTAMPDIFF but I don't know which interval I have to put to analyze the entire date in this format 31/12/1999 16:49:08
    Thanks a lot for your help
    Regards,

    Hi !
    It depends on the interval you need to compare these dates. If you want to know the number of days between these dates, you'll have to use SQL_TSI_DAY as interval. If it's minutes, you'll need SQL_TSI_MINUTE...
    Here are the possible intervals :
    *SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, or
    SQL_TSI_YEAR*
    Hope this will help, feel free to ask more !
    Max

  • Compare two dates in different format.

    Hi
    I want to compare two dates....one of which is in the timeStamp format ("yyyy-MM-dd HH:mm:ss")
    and the other is in java.util.Date i.e Tue Oct 11 10:22:47 GMT+05:30 2005
    Do I have to tokenise and then compare them.Is there any better approach?
    I want to find out which is greater/smaller one.
    Pls help.
    Regards,
    Sandip.

    I would convert both to Date and compare them. To convert String to Date check java.text.SimpleDateFormat and its parse(...) method.
    HTH
    Mike

  • How to Compare two Dates in java

    How to Compare two Date Field after getting the values from jTextField1.getText() and jTextField2.getText().

    Date d1=DateFormat.getDateInstance().parse(yourstring1);
    same for d2
    d1.compareTo(d2);
    could be that i misrememberd the exact naems of some functions or mixed up something in the equence of d1=

  • Urgent Q-adding elements from two data sets

    How to add two fields from two data sets. in RTF template
    the fields have same names too.

    BIPuser wrote:
    If you are grouping within one data set, then the current-group will only work for an element within that group. For the second one, try to use the absolute path or use as many of '../' to get up as many levels from where you are.
    Thanks!I have defined two different groups.
    I need to add the elements from those two diffrent groups.

  • Comparing two data records of same IDOC

    Hi,
    In PI, we need to compare two data records of same IDOC to figure out if what type change occurred.  For example, BENFIT3 IDOC contains data records tilted "E1BEN04".  When there are multiple "E1BEN04" data records, then we need to compare the data inside them to see whether name, or data of birth or SSN is changed. 
    Has anybody came across this before. Your help is much appreciated.
    Thanks
    -Teja

    If it is very few fields then you could use graphical mapping to determine the changes.

  • Comparing two dates and adding days to date

    Hi,
    I want to compare two dates(like 2006/10/21 and 2006/11/2),how can i compare these two dates,like which is greater.And if to the second date,i want to add some number of days like 10 days,how can i add so that the date becomes 2006/11/12).
    Please reply soon.Thanks

    No,all other queries are different,as they have the
    date in this format
    '2006-03-06 " but i have the date in this format
    "2006-03-06 10:26:46.0",
    i.e the time is also assciated with it.
    If I have only the date(in string format or date
    date format 2000/12/1),then I can easily do it,but
    I have the time also.If I have the date only,then I
    can split the date into three strings,and after
    converting into integer I can pass it to the
    constructor,but what about the time?SimpleDateFormat can parse "2006-03-06 10:26:46.0" date too:
               SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SS");
               Date date = dateFormat.parse("2006-03-06 10:26:46.0");
               System.out.println("date = "  +date);

  • Java 1.3 comparing two dates using Calendar.before(Calendar)

    Has anyone used the Calendar.before() method for comparing two dates, how accurate is this?
    Some users have found problem with this method, is this true?

    manjit84 wrote:
    Has anyone used the Calendar.before() method for comparing two dates, Yes.
    how accurate is this?I've never noticed a problem.
    Some users have found problem with this method, is this true?Check the bug database^1^?
    ^1^ http://bugs.sun.com/

  • How to compare two dates that should not exceed morethan 3 years

    hi all,
    can you please tell me how to compare two dates( basically dates are string type)
    that should not exceed more than 3 years? in JAVASCRIPT
    Thanks in Advance.

    This is not a JavaScript forum.
    [*Google* JavaScript Forum|http://www.google.co.uk/search?q=JavaScript+Forum&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a]
    Good luck.

  • How to compare two dates to know which one is greater than oher?

    how to compare two dates to know which one is greater than oher?
    Please search before asking basic questions.
    Edited by: Rob Burbank on Mar 27, 2009 9:26 AM

    Hi,
    If thse to date fields are of same type u can directly compare like this.
    regards,
    Bharat.

  • Compare two dates with NULL in one

    I am trying to do the following with a simple SQL. Compare two dates and get the latest one, but the greatest() function always returns NULL if NULL is present. So how can I do it ?
    Date1 Date2 Desired Result
    Null 01-Dec-09 01-Dec-09
    01-May-09 01-Mar-09 01-May-09
    01-May-09 NULL 01-May-09
    01-May-09 01-Nov-09 01-Nov-09
    NULL NULL NULL
    Any suggestion ? Thanks

    Hi,
    Try this,
    create table test1
    fdate date,
    tdate date
    insert into test1 values (null,'25-jan-2010');
    select greatest(nvl(fdate,tdate),nvl(tdate,fdate)) greatest from test1;
    Thanks&Regards,
    Jai

  • Comparing two dates in a report

    Hello,
    I am attempting to compare two dates in a report in order to format a column. My code for that portion of the report is as follows:
    CASE
       WHEN TO_DATE(DATE_DUE,'DD-MON-YYYY') -
            TO_DATE(sysdate,'DD-MON-YYYY') <= 5 THEN
              '<span class="due">'||DATE_DUE||'</span>'
       ELSE
          DATE_DUE
    END AS DATE_DUE,I'm getting the error message ORA-00932: inconsistent datatypes: expected CHAR got DATE.
    I've been trying to fix the condition to get rid of the error with no success.
    Thanks
    -Brian

    One thing I just noticed that may or may not be the problem is that your case statement is returning two different datatypes depending on the condition. In one part, it is returning a character string of the span tags concatenated with the due_date (which in and of itself are incompatible datatypes) and the second part is returning just a date.
    Again, not sure if the SQL engine will do automatic conversions for you, but this seems to jive with your "char vs. date" error.

  • Comparing two dates+times [bash]

    To compare two dates+times* in bash I have always used date +%s and compared the resulting strings.  Is there a better way to do it?  Thanks.
    * As in "is date+time Y after date+time X?"

    Years ago I wrote a bash script to build a thumbnail gallery webpage for a local directory structure of torrents.  For each torrent, it created the thumbnail of an image with the same name, scraped torrents to get seeders/leechers, parsed a text file of urls and added links below the image with special favicons for commonly linked sites.
    That was a hassle, and I have been afraid to look at the script since I stopped using it.  But the page it produced was pretty sweet.
    Most of the scripts I write are a bit more down-to-earth than that though.
    Last edited by alphaniner (2012-04-25 18:50:02)

Maybe you are looking for

  • Saving a PDF file to a Word Document

    Can someone please tell me how to save a PDF file as a word document?  When I do a "save as" with the doc extension, a window pops up that says, "Save as failed to process this document.  No file was created."  Any help would be appreciated.  Thank y

  • Zen Vision M 30gb battery problems

    i just bought the zen vision m and im already having problemswhen i try using the usb port nothing will happen no charging icon apears ( i left it for h and 30m no results)?so then i got awall adapter and it turned on!!! great!!!but when i disconnect

  • Steps and setup for Creation of Project Contract from Scratch

    Dear All, Steps and setup how to create contract from oracle project contracts? Thanks HNP Edited by: user12197222 on Aug 1, 2012 1:30 AM

  • Using Buffalo LinkStation Live as an iPhoto '09 Library

    I just recently purchased the buffalo linkstation live NAS. It is compatible with both Windows and Mac. I was wondering if it is possible to use the hard drive as a server with my iPhoto library on it, so other DNLA devices can view the videos and pi

  • After startup my iMac's screen turns black

    My iMac start ups normal. I hear the chime, followed by the apple logo and gears. Then the screen goes black but you can still see the cursor clear as day. I can also turn the brightness up and down, but it is still black. Is there anything I can do