Solved

ORA-01031 Error creating a foreign key

Posted on 2006-06-13
1
729 Views
Last Modified: 2009-07-29
Hi!

I want to create a foreign key for the table ASCHEMA.ATABLE that references de table BSCHEMA.BTABLE executing this SQL:

ALTER TABLE ASCHEMA.ATABLE ADD (
  CONSTRAINT ATABLE_BTABLE FOREIGN KEY (TABLEA_ID)
    REFERENCES BSCHEMA.BTABLE(TABLEB_ID));

Oracle says that user doesn't have enought privileges
So, i give the privileges with the following sentence

GRANT ALL PRIVILEGES TO USER;

But, it doesn't work

Any ideas?
0
Comment
Question by:roju
1 Comment
 
LVL 16

Accepted Solution

by:
MohanKNair earned 250 total points
ID: 16892966
Grant ALL privileges on ATABLE to BSCHEMA.

SQL> grant all on ASCHEMA.ATABLE to BSCHEMA;
SQL>
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now