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)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- -----------------------------------------------------------------------------------
-- 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
/

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!