Discussion:
How to using Cursors in Stored Function?
(too old to reply)
jahwa
2007-09-20 08:21:31 UTC
Permalink
I must transfer the row data to column, so I must to write a stored function to do it and must use cursor to transfer the first row to A column and second row to B column.But I search all the using about cursor of DB2, I can't find..Has anyone can help me and give me a sample of the cursor in stored function? thanks...
Andreas Kannegiesser
2007-09-20 09:39:35 UTC
Permalink
Post by jahwa
I must transfer the row data to column, so I must to
write a stored function to do it and must use cursor
to transfer the first row to A column and second row
to B column.But I search all the using about cursor
of DB2, I can't find..Has anyone can help me and
give me a sample of the cursor in stored function?
thanks...
Hi, following an example for a stored procedure using DB2 SQL Procedure Language:

create procedure P ()
language sql

begin
for f1 as select <columns> from <table> do
...
end for;
end@


Good luck,
aka.

Loading...