Is there any data dictionary view,from where I can get default_value for a specific column ?If I've a table with some integer,char,decimal fields and I want to insert default values into those columns.I'm not using default cluase when I create the table.Instead I want to use the default values of those column datatypes(0 for intger,etc).Is that possible from data dictionary ?
05-03-2001, 01:34 PM
You can have a pre-insert trigger on the table that "dumps" desired values in the column whenever it has NULL values being inserted. Other than this you can define "Default Value" clause at the time of table creation. Cannot find anything else.
You can ALTER the table to add the Defalut Value clause.
Check for the required information in : USER_TAB_COLUMNS. The column DATA_DEFAULT stores the default value defined for that column.