X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5b47ed3efe5f4ef0810096b0f4849047cee54690..9fd46de37d7906b7c104c17112b34bae7d534d67:/SL/DBUtils.pm diff --git a/SL/DBUtils.pm b/SL/DBUtils.pm index ecb809baf..4336446fa 100644 --- a/SL/DBUtils.pm +++ b/SL/DBUtils.pm @@ -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) = @_; @@ -74,4 +74,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;