Chapter 3 Guide de référence du SGBD
Requête SQL utilisée pour répertorier les tables référencées par une table.
Dans Oracle 9i :
{OWNER, TABLE, POWNER, PARENT}
select
c.owner,
c.table_name,
r.owner,
r.table_name
from
sys.all_constraints c,
sys.all_constraints r
where
(c.constraint_type = 'R' and c.r_constraint_name = r.constraint_name and c.r_owner = r.owner)
[ and c.owner = %.q:SCHEMA%]
[ and c.table_name = %.q:TABLE%]
union select
c.owner,
c.table_name,
r.owner,
r.table_name
from
sys.all_constraints c,
sys.all_constraints r
where
(r.constraint_type = 'R' and r.r_constraint_name = c.constraint_name and r.r_owner = c.owner)
[ and c.owner = %.q:SCHEMA%]
[ and c.table_name = %.q:TABLE%]
order by 1, 2, 3, 4
| Copyright (C) 2006. Sybase Inc. All rights reserved. |
| |