Re: how to set a DEFAULT value !!



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
.



Relevant Pages

  • Re: Suggestions for tube-type general coverge rcvr, not HQ-180
    ... receivers (none in the ham price category... ... The tuning scheme was so complicated you practically had ... of gear the military used in terms of life cycle support, ... the Ft. Devens radio refit facility did thirty years back. ...
    (rec.radio.amateur.boatanchors)
  • RE: DTS error copying tables
    ... Based on the reference I could reach, the second HRESULT that you ... encountered is facility 4, ... direct assistance from a Microsoft Support Professional through Microsoft ... Product Support Services. ...
    (microsoft.public.sqlserver.dts)
  • Any news on DVB-T radio??
    ... Does anyone know if support for DVB radio is even on the list of ... things MS is planning to add. ... facility there and not be able to use it. ...
    (microsoft.public.windows.mediacenter)
  • Re: RP (Responsible Person) Records
    ... > Not unless you wish to support some (rare) facility that ... > requires them as most people don't bother. ...
    (microsoft.public.win2000.dns)