Help for this page

Select Code to Download


  1. 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;
    
  2. 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' ]
    
  3. or download this
    my $cnt_statement = "SELECT count(*) FROM ($statement)";
    
  4. 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
    
  5. or download this
    my $retval; 
    my $statement = <<"END_PSQL";
    ...
            );
        END;
    END_PSQL
    
  6. or download this
    $dbh->selectrow_array($statement->text_attr_values);
    $statement->prepare_and_bind_on($dbh);
    
  7. or download this
    my @row = $dbh->selectrow_array($statement_or_text);
    my $sth = $dbh->prepare($statement_or_text);
    
  8. or download this
    my $statement2 = sql('SELECT * FROM manggis.files WHERE state = :state
    +');
    $statement2->bind_param(':state', 'F');