in reply to please how can i split string that is over 5MB
in thread Inserting large chunks of data into MySQL
How are you reading $txtque (the one outside of the for loop) into memory in the first place? If it it coming from a file, you might try this:
That is, read in one $txtque value at a time and execute the INSERT statement instead of reading in all of the $txtque values in before doing the inserts.open my $fh, '<', '/the/file/with/txtque' or die "unable to open ...: $!\n"; { local($/) = '~'; while (my $txtque = <$fh>) { my $count = $dbh->do(...); # execute the INSERT statement here } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: please how can i split string that is over 5MB
by askgetanswer (Initiate) on May 04, 2008 at 20:27 UTC |