Re: how to set a DEFAULT value !!
- From: cj10@xxxxxxxxx (Charles Jardine)
- Date: Thu, 27 Apr 2006 14:23:16 +0100
Greg Sabino Mullane wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
Which database server is this?
This is definitely the behavior of MySQL, PostgreSQL, and Oracle,
and I'm pretty sure most others follow it as well.
Whoa. Be careful what you say about Oracle.
Oracle does have default values for table columns, defined
by the DEFAULT clause in CREATE/ALTER TABLE.
However, the _only_ way to get a column set to the default value
is to leave the column out of the INSERT statement altogether.
There is nothing you can put in a VALUES(..) list which
will do the trick, nor is there anything that can be bound to
a placeholder which will result in the default being set.
DBD::Oracle cannot be enhanced to provide a facility
to get a placeholder replaced by the default value for
a column, since the OCI API does not support it.
This seems to me to be a sufficient reason not to attempt
to extend the DBI to provide this facility. Perhaps it would
be better if the authors of DBDs which can support it could
be persuaded to do it using a special bind value, as DBD:Pg
apparently does does.
--
Charles Jardine - Computing Service, University of Cambridge
cj10@xxxxxxxxx Tel: +44 1223 334506, Fax: +44 1223 334679
.
- Follow-Ups:
- Re: how to set a DEFAULT value !!
- From: Greg Sabino Mullane
- Re: how to set a DEFAULT value !!
- References:
- Re: how to set a DEFAULT value !!
- From: Greg Sabino Mullane
- Re: how to set a DEFAULT value !!
- Prev by Date: Re: how to set a DEFAULT value !!
- Next by Date: DBD::ODBC installation problem with Easysoft ODBC-Sybase driver
- Previous by thread: Re: how to set a DEFAULT value !!
- Next by thread: Re: how to set a DEFAULT value !!
- Index(es):
Relevant Pages
|
|