# DBIを使用する時のメモ
#/usr/bin/perl
use DBI;
my $sql = qq|select value1 , value 2, value3 |;
$sql .= qq|from table_name |;
$sql .= qq|where value1 = :1 |;
$sql .= qq|and value2 = :2 |;
my $sth = $dbh->prepare($sql);
$sth->bind_param(1,$param1);
$sth->bind_param(2,$param2);
$sth->execute;
my @array = ();
my $var = $sth->fetchall_arrayref();
foreach(@$var){
#push(@array,@$_);
$value1 = $$_[0];
$value2 = $$_[1];
$value3 = $$_[2];
push(@array,qq|$value1,$value2,$value3|);
}
exit;
コメント