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;
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;