Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* エラー処理 [#wbebf52a]
** エラー判定 [#g8eb3cea]
$sth = $dbh->prepare('update t12 set num = 1 where num >...
if (!$sth->execute()){
print $sth->err,"\n"; #=> 7
print $sth->errstr,"\n"; #=> ERROR: relation "t12" d...
}
** エラーメッセージ表示(PrintError) [#m36160ee]
$dbh->{ShowErrorStatement} = 1;
$dbh->{PrintError} = 1;
** 例外発生(RaiseError) [#b6ae6b8d]
$dbh->{RaiseError} = 1;
eval {
$sth->execute(time); # ERR!
};
die "ERR: $@\n" if $@;
終了行:
* エラー処理 [#wbebf52a]
** エラー判定 [#g8eb3cea]
$sth = $dbh->prepare('update t12 set num = 1 where num >...
if (!$sth->execute()){
print $sth->err,"\n"; #=> 7
print $sth->errstr,"\n"; #=> ERROR: relation "t12" d...
}
** エラーメッセージ表示(PrintError) [#m36160ee]
$dbh->{ShowErrorStatement} = 1;
$dbh->{PrintError} = 1;
** 例外発生(RaiseError) [#b6ae6b8d]
$dbh->{RaiseError} = 1;
eval {
$sth->execute(time); # ERR!
};
die "ERR: $@\n" if $@;
ページ名: