On 4/11/2011 2:03 PM, Mark A wrote:
Quote:
I am using DB2 9.5 FP7 on Linux. I can't find the packages for some
application written UDF's (SQL). Do SQL UDF's have packages?
Also, if a column length is changed via "alter table xxxxx alter column
xxxxx reset datatype xxxxxx" (for example from CHAR(4) to CHAR(6)), I know
the package associated with a SP that uses that table column is marked
invalid (for automatic rebind at next execution). But does the SP or UDF
itself need to get recreated, or just the package get rebound? I see a VALID
column in syscat.routines, but it seems to be the same info as in the
syscat.packages (referring to status of package, not the routine itself).
If a UDF has a body of: (BEGIN ATOMIC... END or only RETURN) and it is
|
NOT in a MODULE then the UDF has no package. It is an "inline SQL UDF"
If it is BGEIN .. nED (no ATOMIC) then teh UDF is "compiled" and it has
a package just like an SQL Procedure.
The same is true for triggers and anonymous blocks.
In DB2 9.7 altering table generally results in invalidation of the
routine itself because the change may have cascading effects (there may
be exceptions/optimizations but I don't know them offhand if they exist).
Dropping an index by contrast will only invalidate the package.
I have blogged about SQL UDF (see below)
In yet another shameless plug there is a Profiler on the Oracle2DB2Wiki
which you may find useful when doing SQL Routines.
It's "work in progress"....
Cheers
Serge
--
Serge Rielau
SQL Architect DB2 for LUW, IBM Toronto Lab
Blog: tinyurl.com/SQLTips4DB2
Wiki: tinyurl.com/Oracle2DB2Wiki
Twitter: srielau