On 1/19/04 7:13 PM, Tim Bunce wrote: > On Mon, Jan 19, 2004 at 11:19:04PM +0000, Tim Bunce wrote: >> When I said "But I do think a "column type system" is needed to >> provide the hooks that'll enable you to do what you want" I'm >> thinking in terms of some way to say "use this code ref by default >> for all fields with a TYPE value of SQL_DATE, for example. > > Just to flesh that out a little more... something like: > > # Override types for which you don't want the default of SQL_VARCHAR > $dbh->{BindColumnTypes} = { > SQL_DATE => SQL_DATE, > SQL_DATETIME => { TYPE => SQL_DATETIME, OnFetch => \&my_inflate_thingy }, > }
What about the other direction, allowing arbitrary code (\&my_deflate_thingie) to run during calls like: $sth->execute($val1, $val2, ...); -John