]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DBUtils.pm
Debugcode...
[mfinanz.git] / SL / DBUtils.pm
index ecb809baf79bbec60ad5ce0235bef4f99fec15f3..78a38177548b7349ca75c710bea2a262388c143e 100644 (file)
@@ -3,7 +3,7 @@ package SL::DBUtils;
 require Exporter;
 @ISA = qw(Exporter);
 
-@EXPORT = qw(conv_i conv_date conv_dateq do_query selectrow_query do_statement dump_query);
+@EXPORT = qw(conv_i conv_date conv_dateq do_query selectrow_query do_statement dump_query quote_db_date);
 
 sub conv_i {
   my ($value, $default) = @_;
@@ -33,6 +33,7 @@ sub do_query {
     $dbh->do($query, undef, @_) ||
       $form->dberror($query . " (" . join(", ", @_) . ")");
   }
+  dump_query(LXDebug::QUERY, '', $query . " (" . join(", ", @_) . ")");
 }
 
 sub selectrow_query {
@@ -74,4 +75,12 @@ sub dump_query {
   $main::lxdebug->message($level, $msg . $query);
 }
 
+sub quote_db_date {
+  my ($str) = @_;
+  return "NULL" unless defined $str;
+  return "current_date" if $str =~ /current_date/;
+  $str =~ s/'/''/g;
+  return "'$str'";
+}
+
 1;