my($sth);
my($statement) = "SELECT * FROM $table". ( @fields
? " WHERE ". join(' AND ',
- map("$_ = ". _quote($record->{$_},$table,$_), @fields)
- )
- : ''
+ map {
+ $record->{$_} eq ''
+ ? "$_ IS NULL"
+ : "$_ = ". _quote($record->{$_},$table,$_)
+ } @fields
+ ) : ''
);
$sth=$dbh->prepare($statement)
or croak $dbh->errstr; #is that a little too harsh? hmm.
my(@diff)=grep $new->getfield($_) ne $old->getfield($_), @fields;
if ( scalar(@diff) == 0 ) {
- carp "Records identical";
+ carp "warning: records identical";
return '';
}
=back
+=head1 VERSION
+
+$Id: Record.pm,v 1.9 1998-11-21 07:26:45 ivan Exp $
+
=head1 BUGS
This module should probably be renamed, since much of the functionality is
ut_phonen got ''; at the end ivan@sisd.com 98-sep-27
$Log: Record.pm,v $
-Revision 1.6 1998-11-15 05:31:03 ivan
+Revision 1.9 1998-11-21 07:26:45 ivan
+"Records identical" carp tells us it is just a warning.
+
+Revision 1.8 1998/11/15 11:02:04 ivan
+bugsquash
+
+Revision 1.7 1998/11/15 10:56:31 ivan
+qsearch gets sames "IS NULL" semantics as other WHERE clauses
+
+Revision 1.6 1998/11/15 05:31:03 ivan
bugfix for new config layout
Revision 1.5 1998/11/13 09:56:51 ivan