in reply to Sqlite DBI $sth->rows
I also recommend turning RaiseError on so that you don't have to explicitly call die and use $dbh->errstr. For example:$query_handle->execute($patient_name);
use strict; use warnings; use DBI; my $name = shift or die "need patient's name\n"; my $dbh = DBI->connect( 'dbi:SQLite:dbname=foo.dbm',undef,undef, {RaiseError=>1} ); my $sth = $dbh->prepare(' SELECT name FROM patient_data WHERE name = ? '); $sth->execute($name); warn "no match for $name\n" unless $sth->rows;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sqlite DBI $sth->rows
by iburrell (Chaplain) on Oct 22, 2003 at 18:28 UTC | |
by runrig (Abbot) on Oct 22, 2003 at 19:00 UTC | |
by Anonymous Monk on Oct 22, 2003 at 20:08 UTC | |
by runrig (Abbot) on Oct 22, 2003 at 22:04 UTC | |
by jeffa (Bishop) on Oct 22, 2003 at 20:48 UTC |