Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re:(4) Dereferencing and DBI methods

by Cirollo (Friar)
on Jul 25, 2001 at 17:39 UTC ( #99665=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: Re: Dereferencing and DBI methods
in thread Dereferencing and DBI methods

Selecting a column rather than a row can be very useful. For example, suppose I want a list of every distinct value in one of my database fields. I can use selectcol_arrayref along with a SELECT DISTINCT statement to slurp the whole column into an array. Any of the other DBI functions would force you to use looping structures or list operators on your fetched data to get the same result, and you would have to bother with prepare, execute, fetch and finish.

If you are using any of the database handle methods (as opposed to statement handle methods), you cannot bind variables becuase you never prepare the statement; DBI does it all for you. This works wonderfully for a one-shot query, where there is no reason to bind variables.

Comment on Re:(4) Dereferencing and DBI methods
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://99665]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2015-11-28 18:10 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls