GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  Oracle
Go To First  |  Previous Question  |  Next Question 
 Oracle  |  Question 163 of 224    Print  
How to find the Foreign keys of all child tables when pass the Parent Table name.
I developed like below.Any experts query ....please send.

select
table_name,constraint_name
from user_cons_columns where column_name=(
select a.COLUMN_NAME from user_cons_columns a,user_constraints b
where a.TABLE_NAME=b.TABLE_NAME
and b.constraint_type in ('P')
and a.TABLE_NAME='DEPT')
and constraint_name like '%FK%'



  
Total Answers and Comments: 2 Last Update: May 13, 2008     Asked by: sheker2007 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 12, 2007 02:19:21   #1  
kishore.giri Member Since: December 2007   Contribution: 15    

RE: How to find the Foreign keys of all child tables when pass the Parent Table name.

MY DEAR,

PLZ QUERY THE DATA DICTIONARY VIEW CALLED 'USER_DEPENDENCIES' AND PASS YOUR PARENT TABLENAME IN THE NAME COLUMN AND ALSO GIVE THE TYPE = TABLE IN THE WHERE CLAUSE OF QUERY.

PLZ TRY IT AND REPLY.


REGARDS
Kishore Kumar Giri


 
Is this answer useful? Yes | No
May 13, 2008 04:43:07   #2  
Imran_Javed Member Since: May 2008   Contribution: 23    

RE: How to find the Foreign keys of all child tables when pass the Parent Table name.
SELECT
  uc.CONSTRAINT_NAME,
  ut.TABLE_NAME,
  ucc.COLUMN_NAME
FROM
  USER_CONS_COLUMNS ucc,
  USER_CONSTRAINTS uc ,
  USER_TABLES ut
WHERE
  uc.table_name = ut.TABLE_NAME  AND
  uc.CONSTRAINT_NAME =ucc.CONSTRAINT_NAME AND
  uc.CONSTRAINT_TYPE = 'R'  AND
  ut.table_name = 'DEPT';

 
Is this answer useful? Yes | No

 Related Questions

I have got the following error when importing few of my package bodies and triggers. ORA-01653: unable to extend table SYS.IDL_UB1$ by 13 in tablespace SYSTEM The tablespace SYSTEM had enough space at the time of import. Later when I tried to create theses objects seperately through a script, they were successfully created. It is important to note that not all package bodies and triggers failed. If you have any idea regarding this error, please let me know the problem and solution, if possible.

Latest Answer : Select * from dba_objects where owner = 'GL' and object_type = 'TABLE'Change GL to AP and AR for respective table info. ...
Read Answers (1) | Asked by : mahendra

I am creating one table in oracle. in database it is allocated some memory for that table. how can i know how much memory that table is holding in that database?

Latest Answer : You can get the current value of the Sequence by querying DBA_SEQUENCESColumn name is Last_numberThanksHari Kiran P. ...
Read Answers (3) | Asked by : ram

Latest Answer : DUAL is a table.That is owned by SYS  user .It has a  column name as dummy and it containts a row having a vale "X".The dual table is useful when u want to retun a value once only,the value that is not derived in from a table with ...
Read Answers (11) | Asked by : Sundra

My table has duplicate values pls help me How can i delete those values For Ex: my table contains 200 rows in that 100 rows are duplicate values and i can i delete those 100 rows pls give me answerregardsmangaiah
Read Answers (9) | Asked by : mangaiah

Latest Answer : Dear friend :  oracle generate sequence numbers with the help of predefined function called nextval.so if you want insert these generated sequence no you can do using .nextvalfor eg:let us say we have the following table:sample:x ...
Read Answers (2) | Asked by : smitesh shinde

Hi,I have scenario where I need to upload data from XML file into a table. XML file is a predifined format. How can I achieve this, Is there any built in package similar to SQL loader to extract required field values and upload them into table.Pls suggestThanks
Read Answers (2) | Asked by : vishnu

Hi, suppose i have 2 managers M1 & M2. S1 & S2 are Sales reps under M1. S3 & S4 are Sales reps under M2. Suppose S1 (whose manager is M1) creates 2 records. S2 will be able to see them ?.Now, if i change the parent position of S1 (i.e., if now, S1 is placed under M2 instead of M1), and responsibility remaining the same as earlier (Sales rep resp), will the Manager M1 be still able to see the records created by S1 ? Please clarify this. Thanks
View Question | Asked by : s

View Question | Asked by : Vikram


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

PHP Oracle Web Development Review

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books The author is also an expert in open source technologies and SOA Service Oriented Architecture But besides
 

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php" document ready function var highlighted
 

jQuery Expanding and Collapsing Table Rows

jQuery Expanding and Collapsing Table Rows The expanding and collapsing behavior added earlier also conflicts with our filters If a section is collapsed and a new filter is chosen then the matching items are displayed even if in the collapsed section Conversely if the table is filtered and a section
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape