Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data selection based on primary key/foreign key constraints

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anyone know a way of extracting data from tables based on primary key/foreign key constraints.

ie. for a given table, and set of values within that table, is there a way of extracting data from tables linked to that table by way of primary key/foregin key constraints, so that any parent tables data, and all child tables data, for tables hierarchically linked to the orignal table, can be extracted.
 
Your question is not very clear. Can you do it by joined select statement?
 
do u want to extract to flat files. U can use sqlplus and spool the output to file. If u wnat to export the data using exp then u can specify the where clause in exp command. hope this helps
 
I think what LFCforthecups wants is:
Given a parent table with a primary key ( e.g. item# )
and 3 child tables with foreign keys (FK) referencing that table's PK , do a query like:

select item# from parent and (all children from all 3
child tables) where item# = 21;
( that is without any where clauses joining the master to the children; just letting the database figure out,
from the referential relationships,
what child records should be displayed )

Nice if it would work, but....sorry, it won't.[sadeyes]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top