I am working on a project involving insertion a lot of data in to the database. I am wondering if anybody knows how to fill 2 or 3 tables in the database at the same time.An example or psueodecode would be helpful. Thanks
-
Are you wanting to do multiple INSERTs in a single request, or do you want to perform parallel INSERTs on separate threads?Marcelo Cantos– Marcelo Cantos2010-04-10 11:00:35 +00:00Commented Apr 10, 2010 at 11:00
-
You almost certainly don't want to use threading for this.Glenn Maynard– Glenn Maynard2010-04-10 17:35:49 +00:00Commented Apr 10, 2010 at 17:35
Add a comment
|
1 Answer
If you have a lot of data to insert into the database all at once, then you probably are interested in bulk loading data. The ideal tool for that is the bulk loader that likely comes with your database -- Oracle, Microsoft SQL Server, Sybase SQL Server, and MySQL (to name the ones that come to mind) all have bulk loaders. For example, Microsoft has the bulk insert statement and the bcp program to perform this task. I recommend you look into that rather than rigging up some tool in python, with or without threads.