Oracle query whether a field is allowed to be empty

The first step is to query all fields of a table:

select * from dba_tab_columns t where t.TABLE_NAME='T_CCCPT'

The result is as follows:


Analysis found that the NULLABLE column has indicated which fields are allowed to be empty and which fields are not allowed to be empty, which are represented by Y and N respectively.

From this, we can know that if we need to query whether the OBJECTID field is allowed to be empty, use the following statement:

select t.NULLABLE from dba_tab_columns t where t.TABLE_NAME='T_CCCPT' and t.COLUMN_NAME='OBJECTID'

The result is as follows:


in line with our expectations.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325547147&siteId=291194637