By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,262 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,262 IT Pros & Developers. It's quick & easy.

Using common table expressions - in line views

P: n/a
Hi,

I have a trigger in which I build a String from the contents of a
table. In a stored procedure I would use a cursor which would look
like:

set str_to_build = '';

create c1 cursor for
select col1 from table1;

fetch c1 into str_var1;

while SQLCODE = 0 do
set str_to_build = str_to_build || str_var1;
fetch c1 into str_var1;
end while;

I would like to do something similar in a trigger. From searching this
forum I came to understand that this can be done using Common Table
Expressions. As I am new to db2 I do not know how this is done. Any
sample code that will help me do this will be greatly appreciated.

Thanks,
Jake
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.