Link to home
Start Free TrialLog in
Avatar of jknj72
jknj72

asked on

Oracle DB Column in table with default for the user

I have a column that I want defaulted to the current user doing the Insert into the table? I have SYSTIMESTAMP as my default for the CREATE_DATE column but now I want the CREATE_BY column defaulted to SYSUSER(I think that is for SQL Server)
Avatar of David VanZandt
David VanZandt
Flag of United States of America image

Check any Oracle SQL reference for the syntax, but you're simply passing the parameter when you define or modify the column, such as column name default sysuser.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jknj72
jknj72

ASKER

Looks like User will work for me. .
If you ever want anything else, you might need to step up to SYS_CONTEXT.  There are a LOT of things you get pull with that:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions184.htm
Avatar of jknj72

ASKER

Thanks Slight. Taking this a bit further so Im posting another question...