index de26b59b58b6b0cc279294b907a74ac3b4f2f754..0560933c190b087e269d36bba002a161b5164c69 100644 (file)
use Digest::MD5 qw(md5 md5_hex md5_base64);
use MIME::Base64;
use XML::Simple;
+use Data::Dumper;
my $op_hash = {
'eq' => '=',
'gt' => '>',
'le' => '<=',
'lt' => '<',
+ 'like' => ' LIKE ',
};
if( exists $phrase->{'operator'} ) {
my $op = $op_hash->{$phrase->{'operator'}[0]};
if( not defined $op ) {
- &main::daemon_log("ERROR: Can not translate operator '$operator' in where ".
+ &main::daemon_log("ERROR: Can not translate operator '$operator' in where-".
"statement to sql valid syntax. Please use 'eq', ".
"'ne', 'ge', 'gt', 'le', 'lt' in xml message\n", 1);
&main::daemon_log($msg, 8);
push(@phrase_l, "$tag$operator'$val'");
}
my $clause_str .= join(" $connector ", @phrase_l);
- push(@clause_l, $clause_str);
+ push(@clause_l, "($clause_str)");
}
if( not 0 == @clause_l ) {
my $select = "*";
if( exists $msg_hash->{'select'} ) {
my $select_l = \@{$msg_hash->{'select'}};
- $select = join(' AND ', @{$select_l});
+ $select = join(', ', @{$select_l});
}
return $select;
}