Skip to Main Content
  • Questions
  • Foreign keys between tables in different schemas

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question.

Asked: March 29, 2006 - 7:57 am UTC

Last updated: March 09, 2007 - 11:09 am UTC

Version: 9.2.0

Viewed 10K+ times! This question is

You Asked

Hi,
I have two tables T1 and T2 in two schemas S1 and S2 in my database respectively. Is it possible to create a referential integrity constraint between these two tables? One column of T1 (Child table) needs to refer to the primary key column of T2 (parent table).
And if this is possible, what grants would S2 need to grant to S1?

Thanks in advance.



and Tom said...

Yes it is.

"grant references on TABLE to WHOMEVER"

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

any "caveat" on this Grant ?

Ed, March 09, 2007 - 1:13 am UTC

Never used or read about this Grant before....
Is there any "caveat" on this Grant ?

On dev db:
I expdp a table from application schema, impdp it into MY dev schema (to debug/data-analysis...)
So need to create FKs refering back to app schema tables.

What sort of impact will this be on the app schema table(s) ?

thanks


Tom Kyte
March 09, 2007 - 11:09 am UTC

well, someone could come along, create a table that points to your table, insert child records and prevent you from deleting a parent.

but that is about it.

Excellent

Ramesh Challa, September 21, 2017 - 2:42 pm UTC

Simple and Straight forward