On Sat, Feb 11, 2006 at 08:05:09PM -0000, Greg Sabino Mullane wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> DBI currently supports sending "NULL" values by using an undef.
> I'd like to propose a mechanism to support another "non-value"
> value, "DEFAULT". Since we've already overloaded simple scalar
> values with use of the undef, the only option I see is to use
> a scalar ref. Specifically, I'd like to propose that a new variable,
> e,g, $DBI::DEFAULT_VARIABLE, be used to indicate a literal value
> of 'DEFAULT' for those databases that support such a thing. This
> would be a small blessed object (thanks to Max Cohan for suggesting
> that instead of a my earlier hashref idea). Drivers would simply
> check if the value passed to execute was a ref, then
> (if ref $value =~ /DBI::Default/) it would use a literal DEFAULT
> instead of a quoted variable.
>
> In other words:
>
> my $foo = "yin";
> my $foo = "yang";
>
> $sth = $dbh->prepare("INSERT INTO mytable(a,b,c,d) VALUES (?,?,?,?)");
> $sth->execute($foo, $bar, undef, $DBI::DEFAULT_VARIABLE);
>
> would send this to the backend:
>
> INSERT INTO mytables(a,b,c,d) VALUES ('yin','yang',NULL,DEFAULT);
>
> And likewise for bind_param, etc.
+1 :)
Cheers,
D
--
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778
Remember to vote!