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 -> DDL Question

DDL Question

From: Rozi & George Goldberger <ghita_at_worldnet.att.net>
Date: 2000/09/20
Message-ID: <8vby5.1071$QI1.98725@bgtnsc04-news.ops.worldnet.att.net>#1/1

Is it possible to use a user defined function in a DEFAULT declaration for a column ?
Something like:

create table test(
col varchar2(36) default myfunc() not null );

create or replace function myfunc
return varchar2 deterministic
is
cGuid varchar2(36);
cNewID varchar2(36) default sys_guid();
begin
cGuid := substr(cNewId,1,8) | | '-' | | substr(cNewId,9,4) | | '-' | | substr(cNewId,13,4) | | '-' | | substr(cNewId,17,4) | | '-' | | substr(cNewId,21,12);
return (cGuid);
end myfunc;

When I do that I receive an ORA-02262 ORA-%05d checking col expression failed Received on Wed Sep 20 2000 - 00:00:00 CDT

Original text of this message

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