Solved

ORA-01031 Error creating a foreign key

Posted on 2006-06-13
1
730 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PL/SQL LOOP CURSOR 3 56
File generation using utl_file 4 45
PL/SQL Search for multiple strings 5 39
Oracle 10g - insert string with special characters 8 41
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

929 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

8 Experts available now in Live!

Get 1:1 Help Now