Oracle query fields by Field Type
Sometimes we need to query specific field information in Oracle through the field name, field type, field length, field comment, table name. For example, my colleague asked me yesterday if blob type is used in our database? At the moment, I cannot figure out which field or table uses the blob type. The following statement is used to query all fields in the database as blob. The specific SQL statement is as follows:
SELECT B. column_name -- field name
, B. data_type -- field type
, B. data_length -- Field Length
, A. comments -- field comment
, A. table_name -- table name
FROM user_col_comments
, All_tab_columns B
WHERE a. table_name = B. table_name and
B. data_type = 'blob'
Group by B. column_name, B. data_type, B. DATA_LENGTH, a. comments,
A. table_name;
The query result is as follows:
This article permanently updates the link address: