Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 meditating upon the Monastery: (9)
As of 2014-08-21 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (143 votes), past polls