Pergunta

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?

Foi útil?

Solução

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

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange
scroll top