Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Default column value as Username
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 toolReceived on Sat Nov 23 2002 - 08:02:21 CST
![]() |
![]() |