Oracle ORA-00903 error analysis of the specific reasons



ORA-00903 invalid table name

ORA-00903: invalid table name

Cause A table or cluster name is invalid or does not exist. This message is also issued if an invalid cluster name or no cluster name is specified in an ALTER CLUSTER or DROP CLUSTER statement.

Action Check spelling. A valid table name or cluster name must begin with a letter and may contain only alphanumeric characters and the special characters $, _, and #. The name must be less than or equal to 30 characters and cannot be a reserved word .

Cause: The table name or cluster name does not exist or is invalid, when running ALTER CLUSTER or DROP CLUSTER statement, this error message appears.

Program: check the spelling is correct. A valid table name or cluster name must start with a letter, contains only letters or numbers, can not exceed 30 characters, can contain some special characters $, _, #. Table name or cluster name can not be keywords.

Case 1: Using the implementation of DDL statements DBMS_SQL package

The DBMS_SQL package can be used to execute DDL statements directly from PL / SQL.

This is a process to create a table example. The process has two parameters: the table name and a list of fields and types.

CREATE OR REPLACE PROCEDURE ddlproc (tablename varchar2, cols varchar2) AS

cursor1 INTEGER;

BEGIN

cursor1: = dbms_sql.open_cursor;

dbms_sql.parse (cursor1,''CREATE TABLE''| | tablename | |''
(''| | Cols | |'')'', dbms_sql.v7);

dbms_sql.close_cursor (cursor1);

end;

/

SQL> execute ddlproc (''MYTABLE'','' COL1 NUMBER, COL2 VARCHAR2 (10 )'');

PL / SQL procedure successfully completed.

SQL> desc mytable;

Name Null? Type
------------------------------- -------- ----
COL1 NUMBER
COL2 VARCHAR2 (10)

Note: DDL statement is executed by the Parese command. Therefore, DDL statements can not use bind variables, or you would be an error message. The following DDL statement in bind variables used in the example is wrong.

backup bin conf config data eshow_sitemap.html generate.sh log maint sitemap.html svn tmp Incorrect Example backup bin conf config data eshow_sitemap.html generate.sh log maint sitemap.html svn tmp

CREATE OR REPLACE PROCEDURE ddlproc (tablename VARCHAR2,

colname VARCHAR2,

coltype VARCHAR2) AS

cursor1 INTEGER;

ignore INTEGER;

BEGIN

cursor1: = dbms_sql.open_cursor;

dbms_sql.parse (cursor1,''CREATE TABLE: x1 (: y1: z1)'', dbms_sql.v7);

dbms_sql.bind_variable (cursor1,'': x1'', tablename);

dbms_sql.bind_variable (cursor1,'': y1'', colname);

dbms_sql.bind_variable (cursor1,'': z1'', coltype);

ignore: = dbms_sql.execute (cursor1);

dbms_sql.close_cursor (cursor1);

end;

/

Although created in the process, no error message. But at run time, you will get an error message "ORA-00903: invalid table name".

SQL> execute ddlproc (''MYTABLE'',''COL1'',''NUMBER'');

begin ddlproc (''MYTABLE'',''COL1'',''NUMBER''); end;

backup bin conf config data eshow_sitemap.html generate.sh log maint sitemap.html svn tmp

ERROR at line 1:

ORA-00903: invalid table name

ORA-06512: at "SYS.DBMS_SYS_SQL", line 239

ORA-06512: at "SYS.DBMS_SQL", line 25

ORA-06512: at "SCOTT.DDLPROC", line 8

ORA-06512: at line 1

Case 2: SQL * Plus error in the trigger

How did you find dbms_error_code figures? I How can Oracle SQL * Plus to display the error message describing it?

Line 1 Error:

ORA-04098:''SYSTEM.LOG_ERRORS_TRIG''trigger is invalid and can not be effective again

ORA-00903: invalid show

ORA error in the error message guide (technet.oracle.com full document can be found) found. The error message that you listed is the SYSTEM ID has called LOG_ERRORS_TRIG the trigger is invalid, because the trigger in reference to an invalid table name. You need to find the trigger code and continue from there.