473,399 Members | 3,919 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,399 software developers and data experts.

SQL help with clearing out old plans and packages

I am attempting to generate FREE PACKAGE statements to get rid of
package from old versions of vendor products. I am refering to
SYSIBM.SYSPACKAGE to select packages generated by the DBRMLIB's of
past releases. The PDSNAMES in the IN clause of the first select
below are the old release DBRM libraries but I wanted to ensure that I
did not FREE any packages that were used in the prior release and were
still used in the current release. Therefore I was using the NOT
EXISTS clause to exclude the PACKAGES from the current release.

I was attempting to use:
SELECT 'FREE PACKAGE '||
STRIP(COLLID)||'.'||STRIP(NAME)||'; --'||PDSNAME
FROM SYSIBM.SYSPACKAGE A
WHERE A.PDSNAME IN (
'OLD1.DBRMLIB',
'OLD2.DBRMLIB',
'OLD3.DBRMLIB')
AND NOT EXISTS
(SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKAGE B
WHERE B.PDSNAME IN (
'current.dbrmlib'));

However when I run this I get zero rows. The problem is that I want it
to count the COLLID/NAME combination as a distinct entry and it
appears that since
the NAME column is the same in the two dbrmlibs it get excluded by the
NOT EXIST SELECT. See the sample of data below.
---------+---------+---------+---------+---------+---------+-------
SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKAGE
WHERE NAME = 'BPASQLG';
---------+---------+---------+---------+---------+---------+-------
COLLID NAME PDSNAME
---------+---------+---------+---------+---------+---------+-------
RBPAPLAN_SQL BPASQLG DB2.PLAT.PL99D1.POST#1.DIST.DBRMLIB
RBPAP512_SQL BPASQLG DB2.PLAT.P512AE.DBRMLIB

What I want is for the prior release entry RBPAP512_SQL.BPASQLG to be
selected to create a FREE PACKAGE statement and the current release
entry RBPAPLAN_SQL.BPASQLG to be excluded.
ANY suggestions?
Nov 12 '05 #1
1 4069
Well I got this to work by adding some equal checks to the NOT EXIST
SELECT. I changed
AND NOT EXISTS
(SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKAGE B
WHERE B.PDSNAME IN (
'current.dbrmlib'));

changed to
AND NOT EXISTS
(SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKAGE B
WHERE B.PDSNAME IN (
'current.dbrmlib')
AND a.name = b.name
AND A.collid = b.collid);



CR******@US.IBM.COM (Jerry Cramer) wrote in message news:<51**************************@posting.google. com>...
I am attempting to generate FREE PACKAGE statements to get rid of
package from old versions of vendor products. I am refering to
SYSIBM.SYSPACKAGE to select packages generated by the DBRMLIB's of
past releases. The PDSNAMES in the IN clause of the first select
below are the old release DBRM libraries but I wanted to ensure that I
did not FREE any packages that were used in the prior release and were
still used in the current release. Therefore I was using the NOT
EXISTS clause to exclude the PACKAGES from the current release.

I was attempting to use:
SELECT 'FREE PACKAGE '||
STRIP(COLLID)||'.'||STRIP(NAME)||'; --'||PDSNAME
FROM SYSIBM.SYSPACKAGE A
WHERE A.PDSNAME IN (
'OLD1.DBRMLIB',
'OLD2.DBRMLIB',
'OLD3.DBRMLIB')
AND NOT EXISTS
(SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKAGE B
WHERE B.PDSNAME IN (
'current.dbrmlib'));

However when I run this I get zero rows. The problem is that I want it
to count the COLLID/NAME combination as a distinct entry and it
appears that since
the NAME column is the same in the two dbrmlibs it get excluded by the
NOT EXIST SELECT. See the sample of data below.
---------+---------+---------+---------+---------+---------+-------
SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKAGE
WHERE NAME = 'BPASQLG';
---------+---------+---------+---------+---------+---------+-------
COLLID NAME PDSNAME
---------+---------+---------+---------+---------+---------+-------
RBPAPLAN_SQL BPASQLG DB2.PLAT.PL99D1.POST#1.DIST.DBRMLIB
RBPAP512_SQL BPASQLG DB2.PLAT.P512AE.DBRMLIB

What I want is for the prior release entry RBPAP512_SQL.BPASQLG to be
selected to create a FREE PACKAGE statement and the current release
entry RBPAPLAN_SQL.BPASQLG to be excluded.
ANY suggestions?

Nov 12 '05 #2

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

Similar topics

0
by: Khawaja Shahzad Sadiq Butt | last post by:
Hi, I am trying to connect to sql server 2000 on win xp. I am using a python extension called. pymssql but it is giving me this errror: Traceback (most recent call last): File...
5
by: Thomas Rademacher | last post by:
Hello, I want to collect with the wildcard '*' all existing directories. For example: /dir/dir/*/dir/*/dir/* or C:\dir\dir\*\dir\*\dir\* How can I resolve this problem? Thanks for your...
3
by: Jason Callas | last post by:
I have a stored procedure that runs as a step in a scheduled job. For some reason the job does not seem to finish when ran from the job but does fine when run from a window in SQL Query. I know...
1
by: Dale Franklin | last post by:
This should be a rather ROUTINE procedure for you DBAs. I keep hearing at technical conferences and user groups the phrase "then rebind all your plans and packages" (after reorg, load, &...
65
by: Steven Watanabe | last post by:
I know that the standard idioms for clearing a list are: (1) mylist = (2) del mylist I guess I'm not in the "slicing frame of mind", as someone put it, but can someone explain what the...
0
by: Michael Bruzdzinski | last post by:
I am hoping that some one in the DB2 community is a 'pack rat' and has a copy of the article "The ABCs of Plans and Packages" by Nicola Nur, which was written in 1994. It appeared in the Database...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
84
by: Patient Guy | last post by:
Which is the better approach in working with Javascript? 1. Server side processing: Web server gets form input, runs it into the Javascript module, and PHP collects the output for document prep....
0
by: Rafe | last post by:
Hi, This seems to be an old question, and I've read back a bit, but rather than assume the answer is "you can't do that", I'd thought I'd post my version of the question along with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.