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
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
Messages: 21802
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
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.

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

Current Time: Tue Feb 27 03:34:47 CST 2024