DBAsupport.com Forums - Powered by vBulletin
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Fk Referenced Tables

  1. #11
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Originally posted by jmodic
    Oracle doesn't have "GRANT REFERENCES ON xy TO wz;" just for looking nicer. Some are actualy using this and having interschema constraints is nothing unusual.
    Doesn't Oracle really have REFERENCES ON xy TO wz;" just for looking nicer :-)

    Now seriously: there are many features in Oracle just for the sake of many features.
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  2. #12
    Join Date
    Aug 2000
    Location
    Jolo, Sulu
    Posts
    639
    Thaks to all of you friends...
    But i want the list of foriegn constraint and its referenced table...
    something like:

    FORIEGN_CONSTRAINT REFERENCED_TABLE REFERENCED_COLUMN
    ------------------

  3. #13
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Code:
    SELECT uc.constraint_name AS fk_constraint,
           ac.owner AS ref_owner,
           ac.table_name AS ref_table,
           acc.column_name AS ref_column
      FROM ALL_CONSTRAINTS ac,
           ALL_CONS_COLUMNS acc,
           USER_CONSTRAINTS uc
     WHERE ac.constraint_type IN ('P','U')
       AND ac.owner = acc.owner
       AND ac.constraint_name = acc.constraint_name
       AND uc.constraint_type = 'R'
       AND uc.r_owner = ac.owner
       AND uc.r_constraint_name = ac.constraint_name
     ORDER BY uc.constraint_name, acc.position;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width