Questions tagged [ora-00942]

Table or view does not exist. Cause: You tried to execute an SQL statement that references a table or view that either does not exist, that you do not have access to, or that belongs to another schema and you didn't reference the table by the schema name.

You tried to execute an SQL statement that references a table or view that either does not exist, that you do not have access to, or that belongs to another schema and you didn't reference the table by the schema name.

References:

85 questions
65
votes
8 answers

Why doesn't Oracle tell you WHICH table or view does not exist?

If you've used Oracle, you've probably gotten the helpful message "ORA-00942: Table or view does not exist". Is there a legitimate technical reason the message doesn't include the name of the missing object? Arguments about this being due to…
erickson
  • 265,237
  • 58
  • 395
  • 493
51
votes
12 answers

Spring Batch Framework - Auto create Batch Table

I just created a batch job using Spring Batch framework, but I don't have Database privileges to run CREATE SQL. When I try to run the batch job I hit the error while the framework tried to create TABLE_BATCH_INSTANCE. I try to disable the…
Einn Hann
  • 651
  • 2
  • 8
  • 17
35
votes
5 answers

ORA-00942: table or view does not exist (works when a separate sql, but does not work inside a oracle function)

When I have a sql statement like select * from table1, it works great, but as soon as I put it into a function, I get: ORA-00942: table or view does not exist How to solve this?
Victor
  • 16,609
  • 71
  • 229
  • 409
17
votes
1 answer

Accessing another user's table within an Oracle Stored Procedure

I'm writing a stored procedure to copy data from one user's table to another schema. Basically, it is a series of INSERT .. SELECT statements such as this: INSERT INTO GESCHAEFTE SELECT * FROM TURAT03.GESCHAEFTE WHERE kong_nr = 1234; This…
Thorsten
  • 12,921
  • 17
  • 60
  • 79
15
votes
10 answers

Getting an exception ORA-00942: table or view does not exist - when inserting into an existing table

I am getting below exception, when trying to insert a batch of rows to an existing table ORA-00942: table or view does not exist I can confirm that the table exists in db and I can insert data to that table using oracle sql developer. But when I…
aquero
  • 843
  • 4
  • 13
  • 30
10
votes
2 answers

Is there a good workaround to the Oracle IMPDP REMAP_SCHEMA issue with triggers (ORA-39083, ORA-00942)?

One can use the Oracle data pump import tool (IMPDP.EXE) to import one schema into another using the REMAP_SCHEMA option. However there is an issue in that triggers are not properly remapped. This leads to the trigger not being created at all with…
VinceJS
  • 1,254
  • 3
  • 18
  • 38
9
votes
3 answers

Oracle PLSQL - Declare a cursor on a non-existing table

I want to declare a cursor on a table that does not exist. Of course, my procedure doesnt compile. This table is a temporary table, and is created by a pre process. It will exist on runtime, but at compile time its another story. For my select /…
Tom
  • 43,810
  • 29
  • 138
  • 169
9
votes
5 answers

ORA-00942: table or view does not exist : How do I find which table or view it is talking about

We're running a java/hibernate app going against ORACLE 10g in TESTING. Once in a while, we're seeing this error: ORA-00942: table or view does not exist Is there a way to find out which table/view(s) ORACLE is talking about ? I know that I can…
anjanb
  • 12,999
  • 18
  • 77
  • 106
7
votes
3 answers

Oracle Create View issue

I am logged in as the dba account and I want to create a view in User1's schema, but selecting data from User2's. I used the following query: CREATE OR REPLACE VIEW User1.NewView (Column1) AS SELECT DISTINCT Column1 FROM User2.Table and I get the…
ntsue
  • 2,325
  • 8
  • 34
  • 53
7
votes
2 answers

Can I create Foreign Keys across Databases?

We have 2 databases - DB1 & DB2. Can I create a table in DB1 that has a relation with one of the tables in DB2? In other words, can I have a Foreign Key in my table from another database? I connect to these databases with different users. Any…
Amir
  • 1,919
  • 8
  • 53
  • 105
6
votes
3 answers

Can't select from dba_tab_cols from within stored procedure (PL/SQL)

I'm trying to SELECT from the dba_tab_cols view from within a stored procedure. It's not working and I don't know why. If I execute the following SQL as a query: SELECT t.data_type FROM dba_tab_cols t WHERE t.table_name = 'ACCOUNTTYPE' AND …
JJ.
  • 5,425
  • 3
  • 26
  • 31
6
votes
4 answers

How to access Oracle system tables from inside of a PL/SQL function or procedure?

I am trying to access information from an Oracle meta-data table from within a function. For example (purposefully simplified): CREATE OR REPLACE PROCEDURE MyProcedure IS users_datafile_path VARCHAR2(100); BEGIN SELECT file_name INTO…
mjumbewu
  • 1,104
  • 5
  • 14
  • 28
6
votes
2 answers

Oracle dba_data_files table doesn't exist

I've been trying to access the dba_data_files table to see whether the autoextend is turned on for my data files. However, even though I'm using Oracle 10g, this table seems to not exist: Connected to: Oracle Database 10g Enterprise Edition Release…
Eli Courtwright
  • 186,300
  • 67
  • 213
  • 256
5
votes
3 answers

dba_jobs_running: table or view does not exist when trying to access from procedure

Simply querying running jobs using something like select * from dba_jobs_running; works fine when executed in my sqldevelopers SQL console. However, it does not work, when having exactly the same statement within a procedure. Compilation fails…
PeterP
  • 4,502
  • 7
  • 22
  • 21
5
votes
3 answers

Oracle SELECT statement not working - ORA-00942

Hopefully a simple question. error_reporting(E_ALL); ini_set('display_errors', '1'); $c = oci_connect('whatmyusrnameis', 'whatmypwdis', 'host'); if ($c) { echo 'connection'; } $s = oci_parse($c, 'select * from…
ale
  • 11,636
  • 27
  • 92
  • 149
1
2 3 4 5 6