Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2017
    Posts
    2

    Unanswered: Hash # in column name

    Hi All

    been struggling with this for the whole day and i gave up

    There is a schema in db 2 having table with column ending with '#'

    like for example -> COLUMNABC#

    and i want to use just a query like

    SELECT ABC.COLUMNABC#
    FROM EXAMPLELIB.CSDHTE ABC ;

    but it does not work also tried with double quotas and so on but it still does not help

    Someone could help?

  2. #2
    Join Date
    Jul 2016
    Location
    Moscow
    Posts
    299
    Provided Answers: 45
    Hi,

    Have you tried this?
    Code:
    SELECT ABC."COLUMNABC#"
    FROM EXAMPLELIB.CSDHTE ABC ;
    If you run it using DB2 CLP, you must escape the double quotes inside the statement:

    db2 "SELECT ABC.\"COLUMNABC#\" FROM EXAMPLELIB.CSDHTE ABC"

    If you still get an error, what's your db2 version?
    Last edited by mark.bb; 06-04-17 at 15:14.
    Regards,
    Mark.

  3. #3
    Join Date
    Jun 2017
    Posts
    2

    abc

    Hi Mark,

    Thanks for your answer.

    What I know about this db is:

    DB2 on AS/400 and im accessing it using client data studio from IBM.

    unfortunately :
    SELECT ABC."COLUMNABC#"
    FROM EXAMPLELIB.CSDHTE ABC ;

    didnt work.

    Do you have other suggestions? I even started wondering whether it's at all possible to work around it..

    Regards

  4. #4
    Join Date
    Jul 2016
    Location
    Moscow
    Posts
    299
    Provided Answers: 45
    Hi,

    What's the error code & message?
    Regards,
    Mark.

Posting Permissions

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