Results 1 to 7 of 7

Thread: SQL Statement

  1. #1
    Join Date
    Feb 2004
    Posts
    10

    Unhappy Unanswered: SQL Statement

    SELECT [MONTH_ID] & 'X' AS Expr1
    FROM DT_MONTH;
    A result above it
    200301X
    A result is MS ACCESS

    how can i do with DB2 Same a result above

  2. #2
    Join Date
    Feb 2004
    Posts
    10

    More Detail

    SELECT [Coumn] & 'THIS IS STRING'
    FROM X
    This case to add string to Feild Data of Microsoft Access

    What SQL Startment to do IN DB2 SQL

    Please help me

  3. #3
    Join Date
    Feb 2002
    Posts
    96
    Try this.

    SELECT MONTH_ID||'X' AS Expr1 FROM DT_MONTH;

  4. #4
    Join Date
    Feb 2004
    Posts
    10

    CAN NOT

    Error: [IBM][CLI Driver][DB2/NT] SQL0440N No function by the name "||" having compatible arguments was found in the function path. SQLSTATE=42884

  5. #5
    Join Date
    Feb 2002
    Posts
    96
    Try this.
    SELECT MONTH_ID concat 'X' AS Expr1 FROM DT_MONTH;

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    The MONTH_ID is probably not character type field. So you shout convert non_character type to charater type because only character types can be concatenated.

    Please try:
    SELECT CHAR(MONTH_ID) CONCAT 'X' AS Expr1 FROM DT_MONTH;

    Hope this works,
    Grofaty

  7. #7
    Join Date
    Feb 2004
    Posts
    10

    EXCELLENT MAN

    Thank you verymuch
    i' just to learn DB2 and just to know to convert the feild before concat anything

Posting Permissions

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