- 追加された行はこの色です。
- 削除された行はこの色です。
- Perl-DBI/エラー処理 へ行く。
- Perl-DBI/エラー処理 の差分を削除
* エラー処理 [#wbebf52a] ** エラー判定 [#g8eb3cea] $sth = $dbh->prepare('update t12 set num = 1 where num > 0'); if (!$sth->execute()){ print $sth->err,"\n"; #=> 7 print $sth->errstr,"\n"; #=> ERROR: relation "t12" does not exist } ** エラーメッセージ表示(PrintError) [#m36160ee] $dbh->{ShowErrorStatement} = 1; $dbh->{PrintError} = 1; ** 例外発生(RaiseError) [#b6ae6b8d] $dbh->{RaiseError} = 1; eval { $sth->execute(time); # ERR! }; die "ERR: $@\n" if $@;