Home » SQL & PL/SQL » SQL & PL/SQL » query needed
query needed [message #189809] Sun, 27 August 2006 23:50 Go to next message
sunsanvin
Messages: 60
Registered: April 2006
Location: Hyderabad
Member

hi friends,
i need a query, which should display like

table_name constraint_name column_name


please guide me to write this.or send me if already there with you.


thank you very much
Re: query needed [message #189824 is a reply to message #189809] Mon, 28 August 2006 00:37 Go to previous messageGo to next message
venkatbollu
Messages: 53
Registered: April 2005
Location: Bangalore
Member

Hi

Use this query for what u asked,

SELECT ut.TABLE_NAME, utc.COLUMN_NAME, uc.CONSTRAINT_NAME, uc.CONSTRAINT_TYPE
FROM user_tables ut, user_tab_columns utc, user_constraints uc
WHERE ut.Table_name = utc.Table_name
AND ut.Table_name = uc.Table_name

If you want any details about the tables or columns or the constraints refer to the table description.

With Regards
Venkat
Re: query needed [message #189842 is a reply to message #189824] Mon, 28 August 2006 01:22 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
There is no need to use user_tables in that query.
Re: query needed [message #189846 is a reply to message #189809] Mon, 28 August 2006 01:29 Go to previous messageGo to next message
venkatbollu
Messages: 53
Registered: April 2005
Location: Bangalore
Member

Yes Frank, you are correct, I did a mistake while sending the post using that table name there. I was supposed to give him the table name for his future reference.
Re: query needed [message #189860 is a reply to message #189824] Mon, 28 August 2006 03:04 Go to previous message
sunsanvin
Messages: 60
Registered: April 2006
Location: Hyderabad
Member

Wow
great query sir.

thank you very much for this Cool
Previous Topic: AUTHID
Next Topic: anybody help me i have 2 problem
Goto Forum:
  


Current Time: Tue Dec 06 04:08:33 CST 2016

Total time taken to generate the page: 0.07982 seconds