cancel
Showing results for 
Search instead for 
Did you mean: 

Why is DROP DBSPACE IF EXISTS gone?

Former Member
2,980

It was possible in 11.0.1 but is not valid as of 12.0.0. It was a useful shortcut, is there a simple rationale behind the decision?

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

Are you sure it actually existed in SA 11? I checked the source code history and the best that I can tell the code never supported it. I see that the documentation makes references to it (in the Remarks section) but the syntax on that same page does not (which AFAICT is correct). I think it must have been a documentation error in v11.0.1?

Breck_Carter
Participant
0 Kudos

FWIW it looks like the IQ Help still uses the one-big-DROP-Help-Topic, and DROP DBSPACES is the only one that does not support IF EXISTS.

I suspect the V11.0.1 Help accidentally included that sentence in the DROP DBSPACE topic when they were split apart from the one-big-DROP-Help-Topic in V10.

MarkCulp
Participant
0 Kudos

Yep, I think there was a copy-and-paste error when preparing the v11.0.1 docs.

Former Member
0 Kudos

Right, the question was regarding the docs; I never tried it on v11.0.1 actually. Thanks.

Answers (2)

Answers (2)

Former Member

I've added a comment on the 11.0.1 docs (DCX) to clarify the fact that IF EXISTS is not supported on the DROP DBSPACE topic. Sorry for the confusion, and thank you for alerting us!

Former Member
0 Kudos

Thanks for the time.

Breck_Carter
Participant

Here is a technique that might help:

BEGIN
   DROP DBSPACE whatever;
   EXCEPTION WHEN OTHERS THEN
END;

If the DBSPACE does not exist, the empty EXCEPTION handler hides the symptom. This works for all kinds of DROP statements.

It doesn't work properly if there is some other reason the DROP fails (security, etc).

Former Member
0 Kudos

Thanks for the alternative and the remark!