• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 664
  • Last Modified:

Moving data from sybase to db2 in vb.net

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 vb.net and possibly bulk copy on the db2 side from the dataset in vb.net 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.
0
garyinmiami2003
Asked:
garyinmiami2003
  • 2
  • 2
2 Solutions
 
CodeCruiserCommented:
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.
0
 
garyinmiami2003Author Commented:
CodeCruiser:

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.
0
 
momi_sabagCommented:
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
0
 
garyinmiami2003Author Commented:
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"
0
 
CodeCruiserCommented:
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.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now