1

I am very sorry if I am asking a very basic question, but I Googled for this and found no useful info. Could you please explain what the Oracle SQLCODE ORA-00942 stands for?

1
  • Was it ORA-00942 or SQL*Loader-00942? They are different error codes. Feb 13, 2014 at 5:40

4 Answers 4

1

From the Oracle Doc:

SQL*Loader-00942: partition string not part of table string

Cause: the specified partition is not part of the specified table

Action: None

1
  • @user3289248:- You are welcome!
    – Rahul Tripathi
    Feb 12, 2014 at 6:10
1

SQLCODE is Oracle variable that is visible throughout a session and its value is modified whenever a statement is executed in oracle. If there is no error after execution of sql statement, its value is set to 0 by Oracle. For all other error status, a negetive value is stored that ranges from -20000 to -1.

If you write SQLCODE=-00942, you are basically checking if value stored in SQLCODE is -00942 (i.e. ORA-00942: table or view does not exist) after executing a particular statement. Oracle throws exception if SQLCODE returned is negative and that we can handle in exception part based on SQLCODE returned.

1

ORA-00942: table or view does not exist.

This does not necessarily mean that the table or view in question does not exist! This error is normally due to the user trying to access a resource to which they don't have the proper privileges - it's not usually because the table doesn't in fact exist, it's just that the user doesn't have the privileges to access it in the way that they wish to!

Login as sysadmin and verify that it exists - if it does, GRANT SELECT (UPDATE... whatever) to your user and then it should start working.

An example is shown here:

GRANT SELECT, INSERT, UPDATE, DELETE ON suppliers TO smithj;

If you find that you are doing this frequently, you should look into the Oracle roles facility which allows you to effectively perform multiple privilege assignements in one statement to groups of users.

i.e. you can assign the HR department access to the salary table but exclude other departments - create a HR role and GRANT SELECT on that table to anyone who has the HR role - much easier than fiddling about GRANTing table access to individuals on an ad-hoc basis! It's explained here.

0
SQL*Loader-00942: partition string not part of table string
    Cause: the specified partition is not part of the specified table
    Action: None

from http://docs.oracle.com/cd/B28359_01/server.111/b28278/ulus.htm#SQL_Loader-00942

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.