473,406 Members | 2,281 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,406 software developers and data experts.

Determinining which PRODCEDUREs need to be REBINDed after a TABLE DROP/CREATE

We're going to expand a COLUMN from a lookup TABLE, which is REFERENCEd
from three other TABLEs, from CHAR(2) to CHAR(5). It is the PK of the
lookup.

To do this, we plan to EXPORT the data, DROP the TABLE, (re-)CREATE the
TABLE with the COLUMN expanded, and LOAD the data. Also, re-add any
FORIEGN KEYs associated with the TABLE. A DB2Look, or a query on
SysCat.References can handle that.

How do we verify which stored PROCEDUREs will be affected by a DROP
(and re-CREATE) TABLE? And will they all need a REBIND?

B.

Oct 19 '06 #1
1 1726
Brian Tkatch wrote:
We're going to expand a COLUMN from a lookup TABLE, which is REFERENCEd
from three other TABLEs, from CHAR(2) to CHAR(5). It is the PK of the
lookup.

To do this, we plan to EXPORT the data, DROP the TABLE, (re-)CREATE the
TABLE with the COLUMN expanded, and LOAD the data. Also, re-add any
FORIEGN KEYs associated with the TABLE. A DB2Look, or a query on
SysCat.References can handle that.

How do we verify which stored PROCEDUREs will be affected by a DROP
(and re-CREATE) TABLE? And will they all need a REBIND?

B.
How's this?

-- Before.
SELECT
'REBIND ' ||
VARCHAR(RTRIM(PkgSchema), 18) ||
'.' ||
VARCHAR
(
(
SELECT
RoutineName
FROM
SysCat.Routines
WHERE
SUBSTR(Implementation, 1, 8) = PackageDep.PkgName
),
18
) ||
';'
FROM
SysCat.PackageDep PackageDep
WHERE
BType = 'T'
AND BSchema = 'EPL'
AND BName IN ('MAUTOTYPE', 'MLINE', 'MSTDHITS', 'MSTUDYPROCESS')
-- After.
SELECT
VARCHAR(Routines.SpecificName, 18),
VARCHAR('REBIND ' || Packages.PkgName || ';', 30)
FROM
Syscat.Routines Routines,
Syscat.RoutineDep RoutineDep,
Syscat.Packages Packages
WHERE
-- Get the routine we want.
Routines.RoutineSchema = 'EPL'
AND Routines.Origin = 'E'
-- Join RoutineDep to get the filename.
AND RoutineDep.RoutineSchema = Routines.RoutineSchema
AND RoutineDep.RoutineName = Routines.RoutineName
AND RoutineDep.BType = 'K'
-- Join Packages to check validity.
AND Packages.PkgSchema = RoutineDep.BSchema
AND Packages.PkgName = RoutineDep.BName
AND Packages.Valid = 'X'
B.

Oct 19 '06 #2

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

Similar topics

9
by: Ed_No_Spam_Please_Weber | last post by:
Hello All & Thanks in advance for your help! Background: 1) tblT_Documents is the primary parent transaction table that has 10 fields and about 250,000 rows 2) There are 9 child tables with...
2
by: Karen Sullivan | last post by:
Hi, all. I'm fairly new to SQL, and I have been trying to create a table from a text file. I have been looking at this for days, and can't find the problem. I get a syntax error " Line 55:...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
3
by: David Link | last post by:
Hi All, Here's a Conditional drop_table func for those interested. There was a thread on this a long time back. We do this all the time : DELETE TABLE sales; CREATE TABLE sales (...);
3
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
7
by: cbielins | last post by:
So yea... I rm-ed a rlv that our TS_FACT2 tblspace was using. So our db went to the crapper. The tblspace didn't have any pertinent info, so I'm ok with dropping the tblspace and starting over. ...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
3
by: Rahul B | last post by:
Hi, I have a user UCLDEV1 which is a part of staff and a group(db2schemagrp1) to which i have not given any permissions. The authorizations of that user are shown as db2 =get authorizations...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.