Question

I am trying to drop an alias to a module, but it is unsuccessful.

When I issue the following script, I cannot drop it

CREATE MODULE TESTS;
CREATE ALIAS T2 FOR MODULE TESTS;
CREATE PUBLIC ALIAS T1 FOR MODULE TESTS;
DROP ALIAS T2;
DROP PUBLIC ALIAS T1;
DROP MODULE TESTS;
DROP ALIAS T2;
DROP PUBLIC ALIAS T1;

I got a message that the alias is not defined:

SQL0204N "SYSPUBLIC.T2" es un nombre no definido.

However, when I query the syscat.modules, I can see the row that defines the alias.

What can I do in order to drop the module?

Was it helpful?

Solution

Based on my playing around with this, you need to specify specifically that you are dropping a module:

DROP ALIAS T2 FOR MODULE;

Otherwise, DB2 only looks for objects in your current schema (which is apparently SYSPUBLIC in this case).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top