Home » SQL & PL/SQL » SQL & PL/SQL » desc table (10.2.0.3, Windows 2003)
desc table [message #389853] Tue, 03 March 2009 15:47 Go to next message
sant_new
Messages: 165
Registered: June 2008
Senior Member
Hi all,

I'm trying to find out if there is any tool or a way to describe a table to output the columns in an alphabetical order.

I greatly appreciate your help.

Thank you.

Re: desc table [message #389854 is a reply to message #389853] Tue, 03 March 2009 15:53 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Like the stuff that can be selected in every order you like from ALL_TAB_COLUMNS?
Re: desc table [message #389855 is a reply to message #389853] Tue, 03 March 2009 16:14 Go to previous messageGo to next message
sant_new
Messages: 165
Registered: June 2008
Senior Member
SELECT COLUMN_NAME FROM all_tab_columns 
WHERE table_name = 'tablename'
order by COLUMN_NAME;


This worked. But the developers would like to describe by running a simple command like desc tablename because they will have to run this query everytime. Is it possible to do this with a stored procedure or any other script?

Thanks again

Re: desc table [message #389858 is a reply to message #389853] Tue, 03 March 2009 16:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
> Is it possible to do this with a stored procedure or any other script?
yes
Re: desc table [message #389863 is a reply to message #389858] Tue, 03 March 2009 17:30 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Might be a good time to find out if that developers can write a simple stored procedure ( or a script/program in whatever language they are developing in) with a little select statement and an output loop.

If not, you are in big trouble anyway. I mean

1) run SQL
2) display result

is about as basic as it gets.

Re: desc table [message #389899 is a reply to message #389863] Wed, 04 March 2009 00:36 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
I think you already are in big problems if your developers can only find columns in a table if the columnlist is sorted alphabetically..
Previous Topic: Cursor For Loop
Next Topic: procedure in out
Goto Forum:
  


Current Time: Thu Feb 06 15:50:23 CST 2025