Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Got ORA- 00903: invalid table name when create table under different schema

Willie WangJul 6 2012 — edited Jul 6 2012
Hi Friends,
I tried to create a table under other schema "test", but failed with ORA- 00903,

but when I switched to schema "test" and issued same DDL, it worked, am I wrong or missing something? please help, thanks in advance.



SQL> conn sys/sys@evdata as sysdba
Connected.
SQL> create user test identified by test;

User created.

SQL> grant connect, resource to test;

Grant succeeded.

SQL> CREATE TABLE test.country
2 (
3 name VARCHAR2(50),
4 code2 VARCHAR2(2),
5 code3 VARCHAR2(3),
6 CONSTRAINT pk_country PRIMARY KEY(code2)
7 USING INDEX
8 (CREATE UNIQUE INDEX uidx_country_code2 ON test.country(code2))
9 );
(CREATE UNIQUE INDEX uidx_country_code2 ON test.country(code2))
*
ERROR at line 8:
ORA-00903: invalid table name


SQL> CREATE TABLE test.country
2 (
3 name VARCHAR2(50),
4 code2 VARCHAR2(2),
5 code3 VARCHAR2(3)
6 );

Table created.

SQL> drop table test.country
2 ;

Table dropped.

SQL> conn test/test@evdata
Connected.
SQL> CREATE TABLE test.country
2 (
3 name VARCHAR2(50),
4 code2 VARCHAR2(2),
5 code3 VARCHAR2(3),
6 CONSTRAINT pk_country PRIMARY KEY(code2)
7 USING INDEX
8 (CREATE UNIQUE INDEX uidx_country_code2 ON test.country(code2))
9 );

Table created.

SQL>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2012
Added on Jul 6 2012
2 comments
2,872 views