× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



In the original script, notice that the DROP PRIMARY KEY is *supposed* to fail with the given setup. The given setup matches what is shown, so the failure is to be expected. One would then move on to the next statement in the script. However I would suggest *not* performing the script, *unless* the final effect of the PF becoming Arrival Sequence Access Path is acceptable; i.e. the physical file will *no longer be keyed* and the file will no longer match its DDS.

Regards, Chuck

On 02 May 2013 08:44, Stone, Joel wrote:
Great idea but it doesn't seem to work; running v5r4.

Any ideas?

runsql 'ALTER TABLE jstone/bzapplprq DROP PRIMARY KEY RESTRICT'

gives error:

Table BZAPPLPRQ in JSTONE does not have a primary or unique key.
RUN QUERY command failed with SQLCODE -539.
RUN QUERY command ended due to error.
STRQMQRY command failed.

DDS:

UNIQUE
R BZAPPLPRQR
XBZ_SEQNBR 10S
...

K XBZ_SEQNBR

rob@xxxxxxxxx on Thursday, May 02, 2013 10:21 AM wrote:

You mean like this:
UNIQUE
R ABR
MYKEY 11A
MYDATA 10A
K MYKEY

INSERT INTO ROB/AB VALUES(1, 1)
1 rows inserted in AB in ROB.
INSERT INTO ROB/AB VALUES(1, 1)
Duplicate key value specified.

ALTER TABLE ROB/AB DROP PRIMARY KEY RESTRICT
Table AB in ROB does not have a primary or unique key.

ALTER TABLE ROB/AB ADD PRIMARY KEY (MYKEY)
ALTER completed for table AB in ROB.

ALTER TABLE ROB/AB DROP PRIMARY KEY RESTRICT
ALTER completed for table AB in ROB.

INSERT INTO ROB/AB VALUES(1, 1)
1 rows inserted in AB in ROB.

Summary: Yes. Even though it already has a primary key ADD the
constraint with SQL and then delete the constraint with SQL and it
drops the primary key.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.