If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL Wrap around question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-08, 14:11
KevinYC KevinYC is offline
Registered User
 
Join Date: Aug 2008
Posts: 42
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 15:19. Reason: make it easier to understand
Reply With Quote
  #2 (permalink)  
Old 09-16-08, 16:56
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #3 (permalink)  
Old 09-16-08, 17:01
KevinYC KevinYC is offline
Registered User
 
Join Date: Aug 2008
Posts: 42
Thank you, Andy
Reply With Quote
  #4 (permalink)  
Old 09-17-08, 03:20
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #5 (permalink)  
Old 09-17-08, 08:45
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
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
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On