Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DEFAULT value - can't use a PL/SQL function ?

452507Jun 15 2007 — edited Jun 15 2007
I wanted to specify a default value based upon a function I wrote. But Oracle doesn't allow this - is that true ? For example:

CREATE OR REPLACE FUNCTION GETUTC
RETURN TIMESTAMP AS
BEGIN
RETURN SYS_EXTRACT_UTC(SYSTIMESTAMP);
END;
/

--This succeeds
create table WorksOK(ID number(10), UTCTime TIMESTAMP DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP));

--But this fails
create table NotOK(ID number(10), UTCTime TIMESTAMP DEFAULT GETUTC);


Thanks,
Andy Mackie
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2007
Added on Jun 15 2007
4 comments
420 views