dbTalk Databases Forums  

Compound statements, how do I send data to the console from them ?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Compound statements, how do I send data to the console from them ? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Derek Clarkson
 
Posts: n/a

Default Compound statements, how do I send data to the console from them ? - 08-19-2003 , 01:45 AM






Hi all,
As part of setting up a database we have, I am writing some scripts to load
core data. Because I need to generate values throughout these scripts and
reuse them, I have embedded the SQL with a compound SQL statement. I.e.

BEGIN ATOMIC
...sql statements ...
END

The problem I have is that if I perform any statement within this block that
would normally produce output on the console, nothing happens. For example,

VALUES (1,2), (3,4), (5,6);

Would normally produce:

1 2
----------- -----------
1 2
3 4
5 6

3 record(s) selected.

But if I wrap a begin block around it, nothing appears on the console. How
can I get output I wish to see to appear ? Also, I can't find any statement
or function for outputting an assembled line of text. For example
'Records:" || reccount, any ideas how to do this with DB2 ??

cio
Derek.


Reply With Quote
  #2  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Compound statements, how do I send data to the console from them ? - 08-19-2003 , 08:42 AM






You can insert them into a table (e.g. a DECLARED GLOBAL TEMPORARY TABLE) an
dthen fetch back.

Cheers
Serge



Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.