Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Question Unanswered: Not able to execute Insert Query with concatenation operator

    Hi,

    I am trying to run following query in a DB2 database,

    INSERT INTO &DATABASE..SLCT_DFN
    VALUES(123,'','2010-1-1','2012-1-1',0,'Test',''
    ,
    'This is a very long line. This is a very long line. This is a '||
    'very long line. This is a very long line. This is a very long '||
    'line. This is a very long line. This is a very long line. This'||
    ' is a very long line. This is a very long line.','TH','')

    but not able to get any success. I have attached screenshot of the error i am getting.
    Can some one help?

    I am sorry i dont know from where to get the DB2 version and other stuff. I tried DB2LEVEL command but may be at wrong panel.
    Attached Thumbnails Attached Thumbnails $41B636D97BB5D5E6.jpg   $3166389A362411E9.jpg  

  2. #2
    Join Date
    Oct 2007
    Posts
    246
    R you trying in db2 Luw i believe the os is of mainframes. In tht case u r in wrong blog and the error says invalid '?' found please chk tht.

    regds
    Paul

  3. #3
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    you can get mainframe help here as well as LUW. A forum that is monitored by more folks on the mainframe is IDUG's DB2-L.
    How are you performing these inserts? as stated above, it seems however you are doing it, the concat operators are being translated to ?. you may want to try writing "concat "instead of "||"

    Dave Nance

  4. #4
    Join Date
    Jun 2007
    Location
    germany
    Posts
    155
    on my mainframe !! is interpreted as the concat operator.
    Dick Brenholtz, Ami in Deutschland

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I think your problem may be that you appear to be doing a line break after the || on your input file. A string (including concats) must all be on one line (or least no line breaks before the end of the string).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Tags for this Thread

Posting Permissions

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