Home » Developer & Programmer » JDeveloper, Java & XML » synonym/grant for constraint tables
synonym/grant for constraint tables [message #361158] Tue, 25 November 2008 04:15 Go to next message
ORAGENASHOK
Messages: 240
Registered: June 2006
Location: Chennai
Senior Member
I have one table tbl in user A with primary key constraint

From user b i want to create one table tbl1 with foreign key which references the user A tbl primary key.


Can i do this i tried but it gives insufficient privilege error.

can anyone sort this problem.
Re: synonym/grant for constraint tables [message #361166 is a reply to message #361158] Tue, 25 November 2008 04:28 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You need to GRANT REFERENCES; check the example (connected as user "scott"):
SQL> create table test
  2  (id    number        primary key,
  3   title varchar2(20)
  4  );

Table created.

SQL> grant references on test to mike;

Grant succeeded.

SQL> connect mike/lion@ora10
Connected.
SQL> create table test_2
  2  (id     number   primary key,
  3   fk_id  number   constraint fk_mike_scott references scott.test (id),
  4   tel    varchar2(10)
  5  );

Table created.

SQL>
Previous Topic: How to write a query
Next Topic: Returning XML recordset from Oracle
Goto Forum:
  


Current Time: Sun Nov 24 00:59:20 CST 2024