Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am new to perl and getting used to the dbi. Is there any way i can shorten this code when i don't have any parameters to pass to my query
It seems long winded for perl!$sql = "select cols from $tableName where col=constant and col2 =const +ant"; my $sth = $db->prepare($sql); $sth->execute or die "SQL Error: $DBI::errstr\n"; while ($row = $sth->fetchrow_hashref) { #analyse each row
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: basic dbi question
by ikegami (Patriarch) on Dec 01, 2010 at 19:49 UTC | |
by Anonymous Monk on Dec 01, 2010 at 20:44 UTC | |
by wallisds (Beadle) on Dec 01, 2010 at 21:07 UTC | |
by ikegami (Patriarch) on Dec 02, 2010 at 01:04 UTC | |
|
Re: basic dbi question
by locked_user sundialsvc4 (Abbot) on Dec 01, 2010 at 21:16 UTC | |
by Anonymous Monk on Dec 01, 2010 at 22:41 UTC | |
|
Re: basic dbi question
by afoken (Chancellor) on Dec 02, 2010 at 14:46 UTC |