I have several user defined functions which are referenced in triggers
and views. For software upgrades, I need to be able to drop the
triggers and views which reference these user defined functions, then
drop and recreate the user defined functions, then recreate all the
views and triggers. I don't imiagine I'm the first person who needed
to do this, and I don't have a lot of db2 experience, so I wanted to
see if there is a common or generally used technique for handling this.
This will be part of the upgrade process in a commercial software
product, so it has to be a programmatic technique, not something done
from the Control center. I have metadata tables which can tell me the
names of all the views and triggers that I need to drop and recreate,
so I don't need a way of finding which views and triggers need to be
recreated, just the ablility to drop and recreate the ones I specify.
This is for DB2 8.1.
Thanks in advance for any advice.
dotyet - 21 Dec 2004 02:19 GMT
Have a look at 'db2look' utility. it extracts the ddl of views,
triggers and udfs and can store them in a plain ascii file. once
extracted, you can then later recreate those objects by executing this
ddl file. the relevant commands would be similar to:
db2look -d SAMPLE -e -o sample.ddl -p -a
db2 -tfv sample.ddl
regards,
dotyet
> I have several user defined functions which are referenced in triggers
> and views. For software upgrades, I need to be able to drop the
[quoted text clipped - 12 lines]
>
> Thanks in advance for any advice.
Stanley Sinclair - 24 Dec 2004 23:15 GMT
May sound irrelevent, but . . .
<<db2look -d SAMPLE -e -o sample.ddl -p -a
<<db2 -tfv sample.ddl>>
Where does one find documentation for all such utilities for DB2 with
their switches and options? (Immediateley I'd like to find them for
db2, but also for Webshpere and everything else that IBM publishes.)
SS
_________
> Have a look at 'db2look' utility. it extracts the ddl of views,
> triggers and udfs and can store them in a plain ascii file. once
[quoted text clipped - 27 lines]
> >
> > Thanks in advance for any advice.
dotyet - 25 Dec 2004 00:02 GMT
As for IBM DB2 UDB, this link may help you:
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp
For WebSphere, this may help:
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp
For everything else which IBM publishes: ;-)
http://publib.boulder.ibm.com/infocenter
enjoy!!
dotyet
dotyet - 25 Dec 2004 00:09 GMT
Small correction:
the last one should be:
http://www.elink.ibmlink.ibm.com/public/applications/publications/cgibin/pbi.cgi
?CTY=US&FNC=ICL
OR you click on "Information Centers and Libraries" link.
regards,
dotyet
Pierre Saint-Jacques - 25 Dec 2004 16:32 GMT
Stanley, try: db2look -h
It lists all options, their meaning and also some examples.
HTH, Pierre and Joyeux Noël
PS: It's sunny and -10°C
> May sound irrelevent, but . . .
>
[quoted text clipped - 69 lines]
>>>
>>>Thanks in advance for any advice.

Signature
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.