DEFAULT value - can't use a PL/SQL function ?
452507Jun 15 2007 — edited Jun 15 2007I 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