473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

HOW-TO: recreate a big set of interdependent UDFs...

Hello,
(Using DB2/LINUX 8.2.0)

HOW-TO: recreate a big set of interdependent UDFs... without having to
do it manually because of the imposed drop order due to the RESTRICT
keyword of the DROP statement.

There are also triggers and views mixed in the spaghetti.

Background: I've a huge set of .sql files which acts as the master
repository of DB objects source code to be re-compiled (DROP & CREATE)
automatically every night in a development database.

Interesting note: Informix, Oracle and SQL Server all permit "drop and
mark dependent objects as invalid".

Nov 12 '05 #1
5 3080
Gustavo Randich wrote:
Hello,
(Using DB2/LINUX 8.2.0)

HOW-TO: recreate a big set of interdependent UDFs... without having to
do it manually because of the imposed drop order due to the RESTRICT
keyword of the DROP statement.

There are also triggers and views mixed in the spaghetti.

Background: I've a huge set of .sql files which acts as the master
repository of DB objects source code to be re-compiled (DROP & CREATE)
automatically every night in a development database. Take a peek at the SYSPROC.DB2LK_DEP_OF() table function.
Interesting note: Informix, Oracle and SQL Server all permit "drop and
mark dependent objects as invalid".

Understood.

Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
> Take a peek at the SYSPROC.DB2LK_DEP_OF() table function.

Thanks, Serge, but what's the meaning of DB2LK_DEP_OF's first
parameter?

Nov 12 '05 #3
Gustavo Randich wrote:
Take a peek at the SYSPROC.DB2LK_DEP_OF() table function.

Thanks, Serge, but what's the meaning of DB2LK_DEP_OF's first
parameter?

Schema and name are not unique for DB2 objects. You could have a table
with the same name.
Check out the BTYPE or DTYPE descriptions fro the various SYSCAT.*DEP*
views.
Here are some (from syscat.routinedep). You want to use 'F', to find all
objects that depend on a given table use 'T':
The beast is an SQL Function. So you can see how it's works by looking
at the SYSCAT.ROUTINES.TEXT column.

A = Alias
F = Routine instance
O = Privilege dependency on all subtables or subviews in a table or view
hierarchy
R = Structured type
S = Materialized query table
T = Table
U = Typed table
V = View
W = Typed view
X = Index extension

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4
Sorry, I can't make work db2lk_dep_of.
Below is an example; Am I doing something wrong?
--
select a.routineschema, b.routinename, c.routinename
from syscat.routinedep a, syscat.routines b, syscat.routines c
where a.btype in ('F', 'P')
and b.routinename = 'GEN_PREMDACNV'
and b.specificname = a.routinename
and c.specificname = a.bname

ARBALLON GEN_PREMDACNV GEN_DIV
ARBALLON GEN_PREMDACNV LOG_LEECODIND
ARBALLON GEN_PREMDACNV LOG_LEEIND
ARBALLON GEN_PREMDACNV SIS_LEECFG
--
select * from
table(sysproc.db2lk_dep_of('F','ARBALLON','GEN_PRE MDACNV')) as a

(Empty result set fetched)
--

Nov 12 '05 #5
Gustavo Randich wrote:
Sorry, I can't make work db2lk_dep_of.
Below is an example; Am I doing something wrong?
--
select a.routineschema, b.routinename, c.routinename
from syscat.routinedep a, syscat.routines b, syscat.routines c
where a.btype in ('F', 'P')
and b.routinename = 'GEN_PREMDACNV'
and b.specificname = a.routinename
and c.specificname = a.bname

ARBALLON GEN_PREMDACNV GEN_DIV
ARBALLON GEN_PREMDACNV LOG_LEECODIND
ARBALLON GEN_PREMDACNV LOG_LEEIND
ARBALLON GEN_PREMDACNV SIS_LEECFG
--
select * from
table(sysproc.db2lk_dep_of('F','ARBALLON','GEN_PRE MDACNV')) as a

(Empty result set fetched)
--

Arghh.. sorry I keep forgetting. Use the SPECIFICNAME as input for
routines (overloading of function names).
A routine is uniquely identifies by its schema and specific name.
So type: 'F', schemaname: 'ARBALLON', name: (SQL????)

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tom Szabo | last post by:
Just wandering how can you close a browser remotely. In some web applications the browser closes or refreshes periodically. How is that done and how can it be done through PHP? TIA, Tom
15
by: Reid Nichol | last post by:
Hello, I was wondering if I could control how many bytes are in an int and the byte order. In C/C++ I can use int32 but how do I do this in python? How can I control byte order?
0
by: v I n O | last post by:
hI Geeks Please do let me know how do i find how many instances sql server running on the single machine. or in the n/w my objective should with help of C#/vb.net
4
by: James Salisbury | last post by:
Hi, I was checking my parent's website salisbury.cabrera.net on google by entering villa rent spain cabrera I can see the required site, ranked at 4, but I am concerend by the return at 1 and 5...
2
by: Frances Del Rio | last post by:
http://www.emol.com/especiales/cocina_chilena/comida.asp this page is so neat (goes in pop-up..) how was this done? how do you give a layer (or div, I guess) a semi-transparency so you can still...
4
by: | last post by:
Developing, building, and testing. How do it the best? Learning from the world leader - Microsoft I'm very interested in how the developing/build/testing workflow @ Microsoft looks like. I...
4
by: Supra | last post by:
in vb6 listbox1.remove item 5 how will i do in vb.net? regards
7
by: anushhprabu | last post by:
#define q(k)main(){ return!puts(#k"\nPRABUq("#k")");} q(#define q(k)main(){return!puts(#k"\nq("#k")");}) guys i'm working on this code.. i got it fromnet.. how this is working.. anyone pls.....
0
by: candra | last post by:
Learn What Hackers Know? -General Hacking Information -Password Security -Scanning, Fingerprinting And Similar Techniques -How Hackers Attack Numerous Internet Services -How Hackers Attack Web...
2
by: belred | last post by:
i just read this blog about how many objects (types) are loaded for a hello world program in C#. http://blogs.msdn.com/abhinaba/archive/2008/09/15/how-many-types-are-loaded-for-hello-world.aspx ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.