Home > database >  Oracle if table 1 does not exist the lookup table 2
Oracle if table 1 does not exist the lookup table 2

Time:09-16


This is a for example, although there is no into the when the second but still will determine whether the conditions of existence of the database to quote ORA - 00942 error,


I meet a problem now, is the product has two versions of the data, one is in table 1, an existing table 2, the inside of the need to remote to query data, although written judgment, matches the version will enter the query corresponding table, but will still be submitted to the ORA - 00942 error, headache,
Guide for BBS bosses

CodePudding user response:

Consider using PL/SQL anonymous block or application code to solve...
For decision table does not exist, is steps before the execution of the SQL

CodePudding user response:

reference 1st floor minsic78 response:
consider using PL/SQL anonymous block or application code to solve...
For decision table does not exist, is steps before the execution of the SQL

Mainly to query data to write generic, because can't predict what kind of environment to detect

CodePudding user response:

I wanted to write a SQL to determine data, if there is no this table, table 1 to table 2. Anyway, the two tables will exist a,
Now is no matter what I write will be submitted to the ORA - 00942 error, head all big

CodePudding user response:

brown fox reference 3 floor response:
I wanted to write a SQL to determine data, if there is no this table, table 1 to table 2. Anyway, the two tables will exist a,
Now is no matter what I write will be submitted to the ORA - 00942 error, head all big


If this table 1 and table 2, you will never have the nuptial other tables exist, then add a SQL to determine did table name is ok, use user_tables then check data dictionary,
  • Related