Hello Alexander and Elke,

> For your purposes, it is more safe to refer to the DOMAIN.* tables and
use 
> SELECT DISTINCT TABLENAME, SCHEMANAME FROM DOMAIN.COLUMNS WHERE KEYPOS
IS NOT NULL
> AND OWNER=USER

Yes thanks, that works.

The reason we do this is a Software Application which is using the
Schema as a System Database. On upgrade we drop all of the non-data
holding objects to make the tables dependency free. Our Create Scripts
work only with ALTER statements, therefore we can run them against an
existing database. Only data mode changes to columns need special
treatments, everything else is re-created.

I agree that for PKs this can be a bit more intelligent, since they dont
restrict other operations. However it works pretty well. I have to test
this with larger tables. It may however also be as easy to change the
create scripts to test for an existing different PK, and then drop this
only if changes are required.

Greetings
Bernd

Reply via email to