oracle query a table exists, if there is a field in a table

Query whether there is a field in a table

select count (0) as aanum 

from user_tab_columns   

where UPPER(column_name)='SEQ_NO' AND TABLE_NAME = 'TEST_TABLE'

 

 

OWNER whether there is a table for the current user under the name of the current user queries

 

select count(1) as bbnum from all_tables where TABLE_NAME = 'TEST_TABLE' and OWNER='select user from dual'; 

 

Published 66 original articles · won praise 8 · views 130 000 +

Guess you like

Origin blog.csdn.net/qq_37889636/article/details/79766829