Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Unanswered: Adding comments to table and columns

    Hi
    I found a solution on this forum itself, for adding comments to tables and columns in the DB.
    But I am unable to find that article again.

    I am creating comments for the columns using TOAD.
    I want to view the comments using sqlplus interface, so that I could create an interface to view comments for different fields in a table.

    Response would be greatly appreciated.
    Thanx and Regards
    Aruneesh

  2. #2
    Join Date
    Jul 2003
    Location
    Near Paris France
    Posts
    60
    select comments from SYS.ALL_COL_COMMENTS (
    where OWNER = :MyOwner
    and TABLE_NAME= :MyTable
    and COLUMN_NAME= :MyColumn

  3. #3
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    select comments give error

    Hi
    I tried "select comments from sys.all_tab_comments" and it works fine, but on trying
    "select comments from sys.all_tab_comments where table_name = policy_documents;"

    I get the following error
    ORA-00904: invalid column name (DBD ERROR: OCIStmtExecute/Describe)

    I also tried with the semi-colon before table_name
    "select comments from sys.all_tab_comments where table_name = olicy_documents;"
    and still the same error.

    Any leads.

    Thanx and Regards
    Aruneesh

  4. #4
    Join Date
    May 2003
    Location
    Dublin, Ireland
    Posts
    44

    Re: select comments give error

    Try:

    select comments from sys.all_tab_comments where table_name = 'table_name';

    where table_name is a name of the table you are insterested in.


    Originally posted by aruneeshsalhotr
    Hi
    I tried "select comments from sys.all_tab_comments" and it works fine, but on trying
    "select comments from sys.all_tab_comments where table_name = policy_documents;"

    I get the following error
    ORA-00904: invalid column name (DBD ERROR: OCIStmtExecute/Describe)

    I also tried with the semi-colon before table_name
    "select comments from sys.all_tab_comments where table_name = olicy_documents;"
    and still the same error.

    Any leads.

    Thanx and Regards
    Aruneesh

  5. #5
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Arrow Thanx it works

    Hi
    Ofcourse the single quotes were required. After all they also are nothing but strings.
    I am creating a Data Dictionary for the DB, and make it available online to all users.
    Thanx and Regards
    Aruneesh

  6. #6
    Join Date
    Jul 2003
    Location
    Near Paris France
    Posts
    60
    Sorry,
    suppress "("
    and replace : by &

    it will be better

  7. #7
    Join Date
    Jul 2003
    Location
    US
    Posts
    314
    Strange

    but both the following quering return "ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute)"

    select comments from sys.all_tab_comments where table_name=&MyColumn

    and

    select comments from sys.all_tab_comments where table_name=&POLICY_DOCUMENTS

    Thanx and Regards
    Aruneesh

  8. #8
    Join Date
    Jul 2003
    Location
    Near Paris France
    Posts
    60
    that's I get
    Attached Files Attached Files

  9. #9
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    so MyColumn was basically a variable

    Hi
    So now I get it what you implied in the first message itself.
    MyColumn was basically your local variable, and you were reading it from the console.

    Thanx for your help dude.
    Thanx and Regards
    Aruneesh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •