LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2013, 10:09 PM   #1
fantasy1215
Member
 
Registered: Oct 2011
Posts: 75

Rep: Reputation: Disabled
How to describe table structure in PL/SQL developer IDE through sql command?


As you know,PL/SQL developer is a good IDE to execute test sql command.
What is the sql command to describe the table structure, table index, primary key, foreign key?
Thanks.
 
Old 04-13-2013, 02:30 AM   #2
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 275Reputation: 275Reputation: 275
Hi,

i don't use PL/SQL developer.
Anyway, for example:

Code:
select * from ALL_TAB_COLUMNS where TABLE_NAME = 'MY_TABLE' order by column_id --(to have desc)
Code:
select * from ALL_INDEXES where TABLE_NAME = 'MY_TABLE' --(to have indexes)
Code:
select * from ALL_CONSTRAINTS where TABLE_NAME = 'MY_TABLE' and CONSTRAINT_TYPE = 'P' --(to have PK)
Code:
select * from ALL_CONSTRAINTS where CONSTRAINT_TYPE='R' and R_CONSTRAINT_NAME in 
  (select CONSTRAINT_NAME
  from ALL_CONSTRAINTS
  where CONSTRAINT_TYPE in ('P','U')
  and TABLE_NAME='MY_TABLE') --(to have FK)
Regards
 
2 members found this post helpful.
Old 04-14-2013, 08:20 PM   #3
fantasy1215
Member
 
Registered: Oct 2011
Posts: 75

Original Poster
Rep: Reputation: Disabled
Thanks so much. This helps me a lot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make an SQL table reference another table? Dornith Programming 4 10-29-2012 01:37 PM
LXer: ITTIA DB SQL Data Distribution Bridges QNX(R) with SQL Server LXer Syndicated Linux News 0 03-14-2012 12:21 AM
installing sql developer smritisingh03 Linux - Newbie 1 02-04-2011 01:53 PM
sql command to copy column from a table tooparam Programming 1 06-19-2007 05:21 AM
LXer: Sql - stored procedures, views, and dynamic sql generation LXer Syndicated Linux News 0 08-17-2006 06:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration