db2admin has asked for the wisdom of the Perl Monks concerning the following question:
So I would like to have @field1, @field2, @field3 created dynamically based on the number of fields in my table. And then be able to populate each array in the while loop.my $sth1 = $dbh->prepare($full_query); $sth1->execute(); # fetch the records while (@data = $sth1->fetchrow_array()) { push @field1, $data[0]; push @field2, $data[1]; push @field3, $data[2]; } $sth1->finish;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: declaring arrays dynamically
by herveus (Prior) on Sep 14, 2004 at 17:36 UTC | |
by jeffa (Bishop) on Sep 15, 2004 at 16:47 UTC | |
|
Re: declaring arrays dynamically
by Old_Gray_Bear (Bishop) on Sep 14, 2004 at 17:37 UTC | |
by ikegami (Patriarch) on Sep 14, 2004 at 18:35 UTC | |
|
Re: declaring arrays dynamically
by CountZero (Bishop) on Sep 14, 2004 at 19:24 UTC | |
|
Re: declaring arrays dynamically
by zdog (Priest) on Sep 14, 2004 at 17:52 UTC | |
|
Re: declaring arrays dynamically
by radiantmatrix (Parson) on Sep 14, 2004 at 18:06 UTC | |
by ikegami (Patriarch) on Sep 14, 2004 at 18:58 UTC |