I would like to list the default values for all columns in all tables in an Oracle database. The objective is to review the default values, and find any that need updating.

There are hundreds of tables in the database with columns that have default values, so it would be preferable to do this programmatically, rather than manually.

How can I do this?

有帮助吗?

解决方案

Check user_tab_cols(all_tab_cols/dba_tab_cols). view . DATA_DEFAULT column, as its' name implies, holds default value for the column.

其他提示

It turns out that the default values I use in my geodatabase are stored in proprietary XML system tables, not in regular Oracle table properties (ALL_TAB_COLS).

The default values can be queried from the XML system tables using a technique similar to what I outline here: GIS Stack Exchange - XML Table Query

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top