Front page | perl.dbi.users |
Postings from December 2006
Re: out of memory
Thread Previous
|
Thread Next
From:
louis fridkis
Date:
December 29, 2006 14:28
Subject:
Re: out of memory
Message ID:
dcab49ed0612291428y69c45768ha9c2884422b8290d@mail.gmail.com
Ron,
Thanks for the suggestions. But, wouldn't it just be better to switch back
to using fetchrow_array()? Is there any advantage to using bind_columns in
this case?
On 12/29/06, Ron Savage <ron@savage.net.au> wrote:
>
> On Fri, 29 Dec 2006 08:46:03 -0800, louis fridkis wrote:
>
> Hi Louis
>
> > Thanks for your reply's. No, I'm not insulted. This is a quick-and-
> > dirty to generate some test data. But, I do appreciate the comments
> > since I am eager to improve.
>
> Glad you're taking it the right way!
>
> > $rv = $cel_sth->bind_columns(\($elementresult_id, $element_id,
> > $quantification_id, $signal));
>
> Why can't you use @rowvalues here?
>
> > while($cel_sth->fetch()){
> > @rowvalues = ($elementresult_id, $element_id, $quantification_id,
> > $signal); # # end # added & replaced #
> > my $printstring= "insert into $table_name values("; foreach my
> > $column (@rowvalues){ if (defined $column){ if($column =~
>
> If you don't change the call to bind_columns(), why can't you use:
> for my $column ($elementresult_id, $element_id,
> $quantification_id, $signal)
> here? That saves copying the info into @rowvalues.
>
> > fetchrow_array(). I changed in the hopes that fetch() would work
> > better. The reason I think it tries to hold all the rows in memory
> > is because it works when the query in $sqlstring returns a small
> > number of rows, but fails with the "out of memory" error when it
> > returns a large number of rows.
>
> That makes me think the problem really is you lack of RAM.
> --
> Cheers
> Ron Savage, ron@savage.net.au on 30/12/2006
> http://savage.net.au/index.html
> Let the record show: Microsoft is not an Australian company
>
>
--
Lou Fridkis
Human Genetics
57920
Thread Previous
|
Thread Next