1 package PciIds::DBQAny;
7 my( $dbh, $queries ) = @_;
9 foreach( keys %{$queries} ) {
10 $qs{$_} = $dbh->prepare( $queries->{$_} );
18 sub queryAll( $$$$ ) {
19 my( $self, $name, $params, $fetch ) = @_;
20 my $q = $self->{'queries'}->{$name};
21 $q->execute( @{$params} );#Will die automatically
23 my @result = @{$q->fetchall_arrayref()};#Copy the array, finish() deletes the content
30 my( $self, $name, $params ) = @_;
31 return queryAll( $self, $name, $params, 1 );
35 my( $self, $name, $params ) = @_;
36 queryAll( $self, $name, $params, 0 );
40 shift->{'dbh'}->commit();
44 shift->{'dbh'}->rollback();
48 return shift->{'dbh'}->last_insert_id( undef, undef, undef, undef );
51 sub dbh( $ ) { return shift->{'dbh'}; }