Go Back   Velocity Reviews > Newsgroups > PERL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

PERL - Re: how to select rows with $dbh->do($sql)

 
Thread Tools Search this Thread
Old 07-11-2003, 02:26 PM   #1
Default Re: how to select rows with $dbh->do($sql)


Can't use "do" for a select, for this very reason - it does not retrun the
data.

<> wrote in message
news:...
> I've read that doing do($sql) is faster than doing a prepare and
> excute, except I can't find how to select the rows in a table.
>
> Something like the following
>
> $sql = "select fieldA, fieldB from table"
> my $row = $dbh->do($sql) or die "select failed";
>
> I can't see how to get the while to loop through the data the select
> would return
>
> while ( $row = fetchrow_hashref )
> { fieldAreturned = $row->(fieldA);
> fieldBretruned = $row->(fieldB)
> }
>
> thanks





Scott Lander
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump