Connecting Tech Pros Worldwide Help | Site Map

Stored procedure

Member
 
Join Date: Jul 2007
Posts: 87
#1: Sep 17 '08
Hi I am used to creating stored procedure with sql server and i am now using an oracle DB. I used to used
[code]
SELECT c.name
FROM sysobjects o
INNER JOIN syscolumns c ON o.id = c.id
WHERE o.name = TBLNAME;
[code]
To return colum names of a given table from the DB but when i put my table name in i get the error table or view does not exist when the table does exist.
Sorry this maybe a really simple question. If you can't do it this way can anyone enlighten me on another way to retreive the colum names

cheers truez
Member
 
Join Date: Jul 2007
Posts: 87
#2: Sep 17 '08

re: Stored procedure


Hi all i managed to get a solution
[code]
SELECT COLUMN_NAME FROM ALL_COL_COMMENTS WHERE TABLE_NAME = tblname as it is in the DB;
[code]
Hope this can help others:)

truez
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#3: Sep 19 '08

re: Stored procedure


you need to use the dictionaly object USER_TAB_COLS for all that information in oracle.
Reply