473,804 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SYSPACKA GE 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.SYSPACKA GE A
WHERE A.PDSNAME IN (
'OLD1.DBRMLIB',
'OLD2.DBRMLIB',
'OLD3.DBRMLIB')
AND NOT EXISTS
(SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKA GE B
WHERE B.PDSNAME IN (
'current.dbrmli b'));

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.SYSPACKA GE
WHERE NAME = 'BPASQLG';
---------+---------+---------+---------+---------+---------+-------
COLLID NAME PDSNAME
---------+---------+---------+---------+---------+---------+-------
RBPAPLAN_SQL BPASQLG DB2.PLAT.PL99D1 .POST#1.DIST.DB RMLIB
RBPAP512_SQL BPASQLG DB2.PLAT.P512AE .DBRMLIB

What I want is for the prior release entry RBPAP512_SQL.BP ASQLG to be
selected to create a FREE PACKAGE statement and the current release
entry RBPAPLAN_SQL.BP ASQLG to be excluded.
ANY suggestions?
Nov 12 '05 #1
1 4108
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.SYSPACKA GE B
WHERE B.PDSNAME IN (
'current.dbrmli b'));

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



CR******@US.IBM .COM (Jerry Cramer) wrote in message news:<51******* *************** ****@posting.go ogle.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.SYSPACKA GE 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.SYSPACKA GE A
WHERE A.PDSNAME IN (
'OLD1.DBRMLIB',
'OLD2.DBRMLIB',
'OLD3.DBRMLIB')
AND NOT EXISTS
(SELECT COLLID, NAME, PDSNAME
FROM SYSIBM.SYSPACKA GE B
WHERE B.PDSNAME IN (
'current.dbrmli b'));

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.SYSPACKA GE
WHERE NAME = 'BPASQLG';
---------+---------+---------+---------+---------+---------+-------
COLLID NAME PDSNAME
---------+---------+---------+---------+---------+---------+-------
RBPAPLAN_SQL BPASQLG DB2.PLAT.PL99D1 .POST#1.DIST.DB RMLIB
RBPAP512_SQL BPASQLG DB2.PLAT.P512AE .DBRMLIB

What I want is for the prior release entry RBPAP512_SQL.BP ASQLG to be
selected to create a FREE PACKAGE statement and the current release
entry RBPAPLAN_SQL.BP ASQLG 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
1534
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 "C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\syndication\db_1.py", line 3, in ?
5
1827
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 hints, Thomas.
3
4375
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 the job is not working because the number of rows that are inserted into the table (see code) is considerably less than the manual runnning of it. I have included the code for the stored procedure, the output from the job, and the output from...
1
2263
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, & runstats, etc). Obviously those plans and packages that need rebinding are only those packages & plans relevant to the tablespace just processed. How do I find out? (I'm on DB2 v7, MVS) I've read five (5) 6-pound books on DB2 (cover-to-cover)...
65
4250
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 difference is between these and: (3) mylist =
0
1234
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 Design and Programming magazine, pages 35-47 (May issue ?). I have tried to locate the magazine on the magazine site but the archives do not go that far back Any help you can give whould be appreciated!
113
5325
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 the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. The built-in SSL support is weak. Even basic sockets don't quite work right; the socket module...
84
3988
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. 2. Client side processing: Web server gets form input and passes it to PHP which includes the Javascript written in a way to make the form input processed on the client side and rendered (probably using DOM function calls) on that side as...
0
1908
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 reproducible error to illustrate my confusion. My problem is that I'm using Python inside XSI (a 3D graphics application). If I want to restart Python, I have to restart XSI. This is no small amount of time wasted.
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10347
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6863
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.