Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Devel::Declare type syntactic sugar for DBI select bind_col param

by moritz (Cardinal)
on Sep 30, 2012 at 14:45 UTC ( #996508=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $dbh->SELECT(':$name, :$email, :$duration(from - to) FROM table WHERE 
    +duration > $min_duration' {
        say "$name <$email> has spent $duration days here";
    }
    
  2. or download this
    $dbh->prepare('SELECT name, email, from - to AS duration FROM table WH
    +ERE duration > ?');
    $dbh->bind_columns(\my ($name, $email, $duration);
    ...
    while ($sth->fetch) {
        say "$name <$email> has spent $duration days here";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (19)
As of 2015-07-06 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls