Oracle Column Defaults Report
This script displays the default values defined for columns in a specified table. It queries the ALL_TAB_COLUMNS view and returns only columns that have a default value assigned, helping users quickly review table default settings.
oraclesqlreporting-analyticsv1.0.0
0 stars0 downloads13 views0 comments
By OracleDba • Created
Code
(16 lines)12345678910111213141516
-- -----------------------------------------------------------------------------------
-- File Name : https://oracle-base.com/dba/monitoring/column_defaults.sql
-- Author : Tim Hall
-- Description : Displays the default values where present for the specified table.
-- Call Syntax : @column_defaults (table-name)
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------
SET LINESIZE 100
SET VERIFY OFF
SELECT a.column_name "Column",
a.data_default "Default"
FROM all_tab_columns a
WHERE a.table_name = Upper('&1')
AND a.data_default IS NOT NULL
/