Re: how to set a DEFAULT value !!




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


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.

You sure about that? You might want to check your docs, or
update to a newer version of Oracle. If I recall correctly,
this ability was added in 9i.

- --
Greg Sabino Mullane greg@xxxxxxxxxxxx
PGP Key: 0x14964AC8 200604271837
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

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

iD8DBQFEUUfrvJuQZxSWSsgRAt/YAKDvcFCDz41zVERWPb3OuI5Bmg3k1QCgyYmt
Z6Id4DtXS519enpBJWN214U=
=/wPB
-----END PGP SIGNATURE-----


.



Relevant Pages

  • Re: Locking question when using Select clause with For Update and Skip locked
    ... table for update and skipped the rows locked by other sessions on same ... select top 1 empno from emp ... (we also have order by clause but will remove it here for simplicity) ... Now on Oracle system it is ...
    (comp.databases.oracle.server)
  • Re: Outer join by (+)
    ... Robert Klemme wrote: ... I can read the standard SQL just fine, because that's what I'm used to. ... WHERE clause excludes. ... This still leaves the issue of lesser expressiveness for the proprietary Oracle syntax. ...
    (comp.databases.oracle.server)
  • Re: How top actually works
    ... So the next one shows that order by clause has affected the result set ... sort these N rows according to my order by clause. ... Ie. you are telling SQL Server ... This is much the same as with rownum in Oracle, ...
    (comp.databases.ms-sqlserver)
  • How top actually works
    ... I'm coming from Oracle world and trying to find something similar to ... So the next one shows that order by clause has affected the result set ... and actually semms to be pushed into inner query. ... the user just ANY N rows satisfying criteria. ...
    (comp.databases.ms-sqlserver)
  • Re: select on a view -> ORA-12571
    ... But if I use the field VID_SBA inside the where- clause I get an error ORA-12571 an the connection to DB is closed. ... Oracle Customer Support. ... If Oracle is installed second time and the error is up and away and I can't reproduce it my application will be delivered without any guarantee whether the problem is solved or not! ... Laurenz Albe ...
    (comp.databases.oracle.misc)