Moving data from sybase to db2 in

Posted on 2012-08-13
Last Modified: 2012-08-13
I have a need to move  data from sybase to db2 for the purpose of combining it with other data to extract to a delimited file.  The strategy I started with was to put the data into a table in db2 and select the rows thru a query connecting to sybase and building an insert query to execute thru a db2 connection. There are 200,000 rows and this sounds inefficient.

I don't see how to employ a bulkcopy but I have done it for sql server?

I'm beginning to think that I could populate a dataset in and possibly bulk copy on the db2 side from the dataset in to an existing table in db2?

I'm looking for good way to do it, not too complicated and sample code showing it?

This is a lot to ask but really appreciate the help.
Question by:garyinmiami2003
    LVL 83

    Accepted Solution

    The only implementation of BulkCopy that I know is the SQLBulkCopy so it wont work with db2. The other option is to populate a dataset from sybase, and an empty dataset from db2, merge the two and then use table adapter's update to insert it to db2.

    Author Comment


    How is that different from:

    Selecting the data from sybase into an internal dataset.  Then looping thru the dataset building db2 inserts (one row at a time) to the db2 table?  I know I can get this to work but was worried about efficiency mostly.

    Appreciate your comments and I'll award points and move on.  Any code sample to make a point would be greatly appreciated.
    LVL 37

    Assisted Solution

    if you can export the data from sybase to a csv file, you would be able to use a db2 command called import which can import that file into a table in a very efficient way

    Author Closing Comment

    Neither solution offered what I really needed.  And neither gave me any code sample but we did not get that far.  I believe the question was not very good.   The comment by momi_sabag  is interesting except that I would have to set something up to output a delimited file, then ftp to another server.  If I have to do that, it does not appear to help.  I have to add to that, that I would need to research the "import" to find out how to use.  He did not offer anything to help with this.

    Any blame for not getting what I need goes to the question, not the experts that's why the "excellent"
    LVL 83

    Expert Comment

    The difference would be that table adapter will be doing the looping for you rather than you looping through the rows and insert. The underlying technique is same though.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now