|
From: Chris W. <ch...@cw...> - 2002-12-24 15:01:36
|
Ray Zimmerman wrote:
> I think that's still wrong ... $rv = ( $rv != 0 ) was correct.
But this removes information that might be useful: returning $rv
gives an indication of the number of rows affected while still
retaining the "return false if no rows affected" semantics. So
you can still do:
my $rows = $class->field_update( ... );
if ( $rows ) {
print "$rows rows affected";
}
else {
print "No rows affected";
}
>> How were you retrieving/using the field types?
>
> I was calling $self->all_field_types() then checking types against
> constants defined in DBI.
You should be able to use something like:
my $type_hash = $class->db_discover_types( $class->table_name );
foreach my $field ( keys %{ $type_hash } ) {
print "$field is DBI type $type_hash->{ $field }\n";
}
SQLInterface->db_discover_types is still the front end for
retriving the types, and under the covers we're still using DBI
types, just getting them in a cleaner manner.
Happy holidays!
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|