How to check if a table exists or not in a database like Oracle, Teradata, SQL Server, DB2, etc. in a generic way.
Option 1:
Select 1 from Table;
Option 2:
Describe Table;
Which one is better or is there any other better way?
Edit: Isn't select 1 from Table
supported by all these databases & generic way to check existence?
Simple answer: there's not a way to accomplish what you are requesting. Different RDBMSs represent schemas, tables, permissions, and data dictionaries in different ways.
Bigger answer: the entity asking the question needs to know what RDBMS it is querying. Then the table existence question can be formed for the database system in question. Even with this information, @data_hinrik is correct, permissions may prevent you from seeing an existing table.