X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a23454bb1b039a31b7f77710ff663fa9152d530c..ba0c9f34b18fbf73fb97cfbf69a1ea679bdd49b0:/SL/DBUpgrade2/Base.pm diff --git a/SL/DBUpgrade2/Base.pm b/SL/DBUpgrade2/Base.pm index 09e4e5fff..2c1e11114 100644 --- a/SL/DBUpgrade2/Base.pm +++ b/SL/DBUpgrade2/Base.pm @@ -41,11 +41,11 @@ sub db_error { } sub db_query { - my ($self, $query, $may_fail) = @_; + my ($self, $query, %params) = @_; - return if $self->dbh->do($query); + return if $self->dbh->do($query, undef, @{ $params{bind} || [] }); - $self->db_error($query) unless $may_fail; + $self->db_error($query) unless $params{may_fail}; $self->dbh->rollback; $self->dbh->begin_work; @@ -204,13 +204,24 @@ C<$coa_name>. Outputs an error message C<$message> to the user and aborts execution. -=item C +=item C -Executes an SQL query. What the method does if the query fails depends -on C<$may_fail>. If it is falsish then the method will simply die -outputting the error message via L. If C<$may_fail> is -trueish then the current transaction will be rolled back, a new one -will be started +Executes an SQL query. The following parameters are supported: + +=over 2 + +=item C + +What the method does if the query fails depends on this parameter. If +it is falsish (the default) then the method will simply die outputting +the error message via L. If C is trueish then the +current transaction will be rolled back, a new one will be started. + +=item C + +An optional array reference containing bind parameter for the query. + +=back =item C