English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hello all,

I am writing a script which loops through the following nearly 300,000 times, putting rows into a database. However, each time it puts in a row, it displays "1 row(s) inserted"
This display is killing the time it takes to put in that massive amount of rows. I tried piping it to /dev/null but it won't work. even when i pipe the entire script to a file, it still displays the inserted comment every time a row is inserted. Any help with this?


echo "
insert into itemfile_tbl
values ('$CTITEMNUMBER','$CTPRICE')
" | dbaccess


Thanks a million!
- Jason

2006-12-15 04:36:26 · 1 answers · asked by Jason 2 in Computers & Internet Programming & Design

Big-
Yeah, there was a script already written that took care of it. Thanks for you answer.

2006-12-17 09:12:07 · update #1

1 answers

First of all, why are you doing 300K inserts from a script? Couldn't you use one of the DB importing tools to make the process more efficient? For example, in Oracle, you could use SQL*Loader which would run so much faster than a script with all those inserts.

Looks like part of the problem is also in the mechanism you're using. Does each insert require you to connect to the database, do the insert, then disconnect? If so, WOW! that's a lot of overhead.

It's hard to say how to do it without knowing what dbaccess is. Is that a program that's taking the input of the echo command? Is it a shell function?

2006-12-15 06:16:45 · answer #1 · answered by BigRez 6 · 1 0

fedest.com, questions and answers