Stored procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • truezplaya
    New Member
    • Jul 2007
    • 115

    Stored procedure

    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
  • truezplaya
    New Member
    • Jul 2007
    • 115

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

    truez

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

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

      Comment

      Working...