Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Default column value as Username

Re: Default column value as Username

From: Andy Hassall <andy_at_andyh.org>
Date: Sat, 23 Nov 2002 14:02:21 +0000
Message-ID: <bd2vtuk9uckgji8ildj03h74rafdbc9mjp@4ax.com>


On Sat, 23 Nov 2002 18:32:05 +1100, "Howard J. Rogers" <howardjr2000_at_yahoo.com.au> wrote:

>SQL> create table test (
> 2 col1 number,
> 3 col2 varchar2(15) default (user));
>Table created.
>
>This was done on 9i Release 2 (Windows), so maybe it's a version dependent
>thing. But yes, given the (possible) restriction on version, it does work
>and is quite a nice feature.

 8i manual says it's fine:
http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76965/c08schem.htm#2880

Legal default values include any literal or expression that does not refer to a column, LEVEL, ROWNUM, or PRIOR. Default values can include the SQL functions SYSDATE, USER, USERENV, and UID. The datatype of the default literal or expression must match or be convertible to the column datatype.

-- 
Andy Hassall (andy@andyh.org) icq(5747695) http://www.andyh.org
http://www.andyhsoftware.co.uk/space | disk usage analysis tool
Received on Sat Nov 23 2002 - 08:02:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US