-----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.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200602111455
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFD7kI2vJuQZxSWSsgRAuS/AJ9l4BPpcPzr+rpcAxa6bWVZuHs4CACeMBp6
nzLTh00cnOL6GbBL6TW3hpU=
=vb2/
-----END PGP SIGNATURE-----


Reply via email to