Discussion:
How to Create multiple functions, Procedures
(too old to reply)
Austin Lopes
2007-07-20 11:20:13 UTC
Permalink
I have db2look from a database, and I need to create about 50 functions & 100 procedures , but have a problem of inter-dependency, how do i avoid this..I dont know which are to be created first , such that no other function or procedure is dependent on it..etc.? Thanks!!..is there any switch in db2 udb that i can use...?
Knut Stolze
2007-07-20 14:44:23 UTC
Permalink
Post by Austin Lopes
I have db2look from a database, and I need to create about 50 functions &
100 procedures , but have a problem of inter-dependency, how do i avoid
this..I dont know which are to be created first , such that no other
function or procedure is dependent on it..etc.? Thanks!!..is there any
switch in db2 udb that i can use...?
If they are dependent on each other, you must create them in the proper
order. That's just the way it is.

What you could do is to run your script multiple times until you only
get "duplicate name" errors and no others.
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Blair Kenneth Adamache
2007-07-20 15:57:31 UTC
Permalink
Post by Austin Lopes
I have db2look from a database, and I need to create about 50 functions & 100 procedures , but have a problem of inter-dependency, how do i avoid this..I dont know which are to be created first , such that no other function or procedure is dependent on it..etc.? Thanks!!..is there any switch in db2 udb that i can use...?
Perhaps query the CREATE_TIME and recreate them in the same order:

select procname, create_time from syscat.procedures
Knut Stolze
2007-07-23 10:03:56 UTC
Permalink
Post by Blair Kenneth Adamache
Post by Austin Lopes
I have db2look from a database, and I need to create about 50 functions &
100 procedures , but have a problem of inter-dependency, how do i avoid
this..I dont know which are to be created first , such that no other
function or procedure is dependent on it..etc.? Thanks!!..is there any
switch in db2 udb that i can use...?
select procname, create_time from syscat.procedures
Actually, db2look already takes care of that.
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Austin Lopes
2007-08-16 17:04:08 UTC
Permalink
no.. db2look does not arrange in proper order....
is there any other way guys?
Knut Stolze
2007-08-17 06:15:08 UTC
Permalink
Post by Austin Lopes
no.. db2look does not arrange in proper order....
is there any other way guys?
Do you have an example that shows an incorrect order? I'm asking because I
just created a few 100 functions which partly depend on each other and
index extensions, and db2look used the correct order amongst these objects.

If you don't get the correct order, the official way is to open a PMR with
IBM support since this is a bug in db2look. (But as I said, I would like
to see an example where this fails.)
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Austin Lopes
2007-08-22 21:02:34 UTC
Permalink
May be its with the db2 versions , i am using v8.2 FP 14..What about you?
Knut Stolze
2007-08-23 08:02:15 UTC
Permalink
Post by Austin Lopes
May be its with the db2 versions , i am using v8.2 FP 14..What about you?
I never saw such problems. (I believe I started using db2look with V7.)

Again, do you have an example that shows the problem?
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Loading...