Hi, I just discovered that perl module: DBIx::SearchBuilder 0.97 has a LoadByCols() method that builds a generic SELECT query that seems to assume '' is a valid value to test on any field. (The code is : ------------------------------------------------------------------ sub LoadByCols { my $self = shift; my %hash = (@_); my (@bind, @phrases); foreach my $key (keys %hash) { if (defined $hash{$key} && $hash{$key} ne '') { my $op; my $value; if (ref $hash{$key} eq 'HASH') { $op = $hash{$key}->{operator}; $value = $hash{$key}->{value}; } else { $op = '='; $value = $hash{$key}; }
push @phrases, "$key $op ?"; push @bind, $value; } else { push @phrases, "($key IS NULL OR $key = '')"; } } my $QueryString = "SELECT * FROM ".$self->Table." WHERE ". join(' AND ', @phrases) ; return ($self->_LoadFromSQL($QueryString, @bind)); } ----------------------------------------------------------- ) PG 7.3.4 generates a "pg_atoi: zero-length string" error when '' can't be coerced to the column type. I understand the reason for changing this behavior from 7.2... Can anyone point me to a version of DBIx::SearchBuilder that works with PG 7.3.4 and above? Thanks! Steve -- Steve Wampler -- [EMAIL PROTECTED] The gods that smiled on your birth are now laughing out loud. ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])