Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    55

    Unanswered: SQL Continuation question

    Hello,

    How do I continue a query statement? The content of COMMENT5 is too long for the screen. Therefore I have to write the statement on two different lines. Will this example work?

    UPDATE ADUADS01.ADVTB939
    SET COMMENT5 =
    ' WHEN SHE IS READY TO MOVE ON THIS. MAY BE A YEAR OR TWO BEF'
    WHERE EID = '0000323006';



    Thank you for any input!
    Last edited by KevinYC; 09-16-08 at 16:19. Reason: make it easier to understand

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I am assuming you are using the CLP. If you have to goto another line you can use the backslash as a continuation character.

    Andy

  3. #3
    Join Date
    Aug 2008
    Posts
    55
    Thank you, Andy

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Alternatively, you already use a statement terminator (';'). If you run the CLP in this mode (i.e. with the -t option), DB2 will parse all lines up to that statement terminator.

    p.s: The statement terminator is not part of the SQL statement - it just separates multiple SQL statements.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    the easiest way would be
    create a file keeping the statements terminated with any character (default
    and execute with
    db2 -tvf filename
    or db2 -stvf filename
    see info center for detail of options specified...
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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