- or download this
use Akar::DBI::Statement qw(sql sql_in sql_param sql_param_inout);
...
. "\n AND created > to_date(". sql_param($start_date ). ", 'YYYY-
+MM-DD')";
my ( $text, $values_ref ) = $statement->text_and_values;
- or download this
# text:
'SELECT id, filetype, filesource_name
...
AND created > to_date(?, \'YYYY-MM-DD\')'
# values_ref is
[ 'durian', 'durianloader_in', 'durianloader_out', 'f', 'F', '2007
+-06-01' ]
- or download this
my $cnt_statement = "SELECT count(*) FROM ($statement)";
- or download this
use Interpolation
'sqlp' => sub { sql_param(@_) },
...
AND state IN $E{ sql_in('f', 'F') }
AND created > to_date( $sqlp{ $start_date } , 'YYYY-MM-DD');
END_SELECT
- or download this
my $retval;
my $statement = <<"END_PSQL";
...
);
END;
END_PSQL
- or download this
$dbh->selectrow_array($statement->text_attr_values);
$statement->prepare_and_bind_on($dbh);
- or download this
my @row = $dbh->selectrow_array($statement_or_text);
my $sth = $dbh->prepare($statement_or_text);
- or download this
my $statement2 = sql('SELECT * FROM manggis.files WHERE state = :state
+');
$statement2->bind_param(':state', 'F');