awohld has asked for the wisdom of the Perl Monks concerning the following question:
use SQL::Abstract; my $sql = SQL::Abstract->new; # get query string my ( $stmt, @bind ) = $sql->select( 'yahoo.finance.historicaldata', [ '*' ], [ -and => [ symbol => $arg{'symbols'}, endDate => $arg{'end_dt'}->ymd('-'), startDate => $arg{'start_dt'}->ymd('-'), ], ], ); ### outputs # $stmt = 'SELECT * FROM yahoo.finance.historicaldata WHERE ( ( ( symb +ol = ? OR symbol = ? ) AND endDate = ? AND startDate = ? ) )'; #\@bind = [ # 'VZ', # 'T', # '2013-10-19', # '2013-10-29' # ]; # ### wanted # $stmt = 'SELECT * FROM yahoo.finance.historicaldata WHERE ( ( ( symb +ol = VZ OR symbol = T ) AND endDate = 2013-10-29 AND startDate = 2013 +-10-19 ) )';
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fill in SQL from Bind Values
by rminner (Chaplain) on Oct 29, 2013 at 06:22 UTC | |
Re: Fill in SQL from Bind Values
by awohld (Hermit) on Oct 29, 2013 at 05:26 UTC | |
by hdb (Monsignor) on Oct 29, 2013 at 09:00 UTC |