Retrieve column names with aliases [message #667174] |
Tue, 12 December 2017 11:50 |
|
ananya.saphira
Messages: 2 Registered: December 2017
|
Junior Member |
|
|
Hi, I need to retrieve all the column names of the table for some of the columns i need it to be a aliases, can you please help me with hoe it can be achieved.
example if columns are name,age,attribute1 then I nee attribute1 one as an alias address.
i dont need data in the columns i just need to select and display all column names of the table.
Thank you.
|
|
|
|
|
|
|
|
|
Re: Retrieve column names with aliases [message #667181 is a reply to message #667176] |
Tue, 12 December 2017 15:14 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
ananya.saphira wrote on Tue, 12 December 2017 13:02I have a table with name employee and it has columns name , age, attribute1.
Now i query the columns with
SELECT column_name
FROM all_tab_cols
WHERE table_name = 'employee';
Using a lowercase name like this will not retrieve any rows for a properly named table (ie. a properly named and created table).
If you created the table initially with double quotes, then this is the way to do it, but that would have been a mistake in the first place.
|
|
|