Skip to Main Content

Oracle Database Discussions

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!

Function base column default value

bobmaganApr 19 2013 — edited Apr 19 2013
Running 11.2 DB. I had heard about using sys_guid() for creating unique values for primary keys and setting it as the column default (like below), but wanted to use my own function instead.
CREATE TABLE MYTABLE
(PK_ID VARCHAR2(32) default sys_guid()

Is it true that you cannot set the column default to a user created function?
Is the only alternative creating a before insert trigger?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2013
Added on Apr 19 2013
5 comments
2,342 views