-- Obtain the table primary key and type
Select acc. column_name, ATC. data_type
From all_constraints AC, all_cons_columns ACC, all_tab_columns ATC
Where AC. table_name = upper ('table name ')
And AC. constraint_type = 'P'
And AC. constraint_name = acc. constraint_name
And AC. table_name = ATC. table_name
And acc. column_name = ATC. column_name
Select acc. column_name
From all_constraints AC, all_cons_columns ACC
Where AC. table_name = upper ('table name ')
And AC. constraint_type = 'P'
And AC. constraint_name = acc. constraint_name
-- Obtain fields of the specified type in the table
Select column_name as cloumn
From all_tab_columns
Where table_name = upper ('table name ')
And data_type = 'varchar2 ';
-- Obtain the table containing the Date Field in the primary key, which can also be specified as number, varchar2
select ACC. column_name, ATC. data_type, ATC. table_name
from all_constraints AC, all_cons_columns ACC, all_tab_columns ATC
where AC. constraint_type = 'P'
and AC. constraint_name = ACC. constraint_name
and AC. table_name = ATC. table_name
and ACC. column_name = ATC. column_name
and ATC. data_type = 'date';