Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

db2 Function HELP

Status
Not open for further replies.

ks9072

Programmer
Mar 17, 2005
1
US
Hi,

I like to write a DB2 function .. like this :

Create Function fun1 (My_EMPNO Varchar(20) )
return Varchar(200)
Begin

Declare st1 varchar(20);
Declare st2 varchar(200);
Declare Cursor c1 select EMP_DESC from EMP where EMPNO=My_EMPNO;
open c1
While c1 not founc()

fetch c1 into st1;
set st2=st2+st1;
end while;
close c1;
returns st2;
end;


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top