set echo off
set verify off
accept xTable prompt 'Enter Table Name: '
TTITLE LEFT 'Child Tables for the table: '&xTABLE
break on TABLE_NAME
SELECT B.TABLE_NAME, C.COLUMN_NAME,
C.POSITION
FROM USER_CONSTRAINTS A,
USER_CONSTRAINTS B,
USER_CONS_COLUMNS C
WHERE
A.CONSTRAINT_NAME=
B.R_CONSTRAINT_NAME
AND
A.TABLE_NAME = C.TABLE_NAME
AND
A.CONSTRAINT_NAME = C.CONSTRAINT_NAME
AND
A.TABLE_NAME = UPPER('&xTable')
ORDER BY B.TABLE_NAME, C.POSITION;
TTITLE LEFT 'Parent tables for the table: '&xTable
SELECT A.TABLE_NAME, C.COLUMN_NAME,
C.POSITION
FROM USER_CONSTRAINTS A,
USER_CONSTRAINTS B,
USER_CONS_COLUMNS C
WHERE
A.CONSTRAINT_NAME=B.R_CONSTRAINT_NAME
AND
B.TABLE_NAME = C.TABLE_NAME
AND
B.CONSTRAINT_NAME = C.CONSTRAINT_NAME
AND
B.TABLE_NAME = UPPER('&xTable')
ORDER BY A.TABLE_NAME, C.POSITION;
Welcome to the GEEK world, best place where you find topic about latest cutting edge technology on website and mobile. Learn and grow your knowledge with the information and tutorials about Website designing, CSS tutorials, Java Script tutorials, Ruby tutorials, ROR tutorials, HTML tutorials, HTML5 , JQuery, Javascript tutorials, Photoshop tutorials, Flash, games tutorials, Cheat sheets, Design tools, Action Scripts as well as MySql, Oracle and many more in a easy way to use and understand.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment