Chapter 3 DBMS Reference Guide
SQL query used to list the joins in a reference.
In Oracle 8:
SELECT COL2.COLUMN_NAME, COL1.COLUMN_NAME FROM SYS.ALL_CONS_COLUMNS COL1, SYS.ALL_CONS_COLUMNS COL2 WHERE COL1.POSITION = COL2.POSITION AND COL1.OWNER='%SCHEMA%' AND COL1.TABLE_NAME='%TABLE%' AND COL2.OWNER='%POWNER%' AND COL2.TABLE_NAME='%PARENT%' AND COL1.CONSTRAINT_NAME='%FKCONSTRAINT%' AND COL2.CONSTRAINT_NAME='%PKCONSTRAINT%' ORDER BY COL1.POSITION
Copyright (C) 2005. Sybase Inc. All rights reserved. |