Is it possible to define user defined functions in a stored procedure in DB2? I need quite a few of them and most of them are only needed in one stored proc. Is it possible to scope them to the stored procedure so that I don’t have to define them at the database level?
Share
No, you can’t do this. However, if you use modules (available in DB2 9.7 and newer), you can define functions within the module aren’t availble for use outside of the module.
Here’s a good article covering the basics of modules, written by the lead SQL architect for DB2.