3

I am creating my tablespaces in the sql scripts that create the database schema. This causes a problem in continuous integration processes, where consecutive execution of the script is not possible because it always tries to create a new instance of the same tablespace.

For triggers there is the call CREATE OR REPLACE TRIGGER but I couldn't find one for tablespaces. Any way around this other than dropping the tablespaces when the schema is dropped?

mustaccio
  • 28,207
  • 24
  • 60
  • 76
user1340582
  • 193
  • 4

1 Answers1

0

You can do it programmatically by querying the catalog. However, there is no command like in DB2.

You can query the view SYSCAT.TBSPACES and look for you tablespace. If it exists drop it, then create a new one.

Tom V
  • 15,752
  • 7
  • 66
  • 87
AngocA
  • 585
  • 5
  • 17