Results 1 to 5 of 5

Thread: getColumnnames

  1. #1
    Join Date
    Dec 2011
    Posts
    18

    Question Unanswered: getColumnnames

    hi all,
    is there any query regarding column names.

    form e.g.
    select colname from syscat.COLUMNS where ....
    it's not working.

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    What are your DB2 version/release/fixpack and platform OS?

    "it's not working."
    Did you received error message(s)?
    or
    The results were different from your expectations?

  3. #3
    Join Date
    Dec 2011
    Posts
    18

    get columnnames

    DATABASE version - 9.5 (Windows)

    when i try to execute
    select colname from syscat.COLUMNS where TABSCHEMA = "abc"
    (lets say abc is my schema name)

    ERROR: An undefined column or parameter name was detected.

    DB2
    SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=IRISDBTO,
    DRIVER=3.57.82
    Error Code: -206

    Query = select colname from
    syscat.COLUMNS where TABSCHEMA = "abc"

  4. #4
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Learn how to quote your literals.
    Single-quotes for character-strings ,e.g 'abc' not "abc"

  5. #5
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    "abc"

    It should be 'abc'.
    Use single quotation.

    And use upper case for schema name, unless you creared tables like
    CREATE TABLE "abc".table-name ...

Posting Permissions

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