Drop table with constraints

K

kahriboo

Hi !!

I've created two table T1 and T2 (in SQL) :

T1
- att1 : counter (key)
- att2 : memo

T2
- att1 : counter (key)
- att2 : boolean
- att3 : date
- att4 : integer

Then (in SQL too) I alter the table T2 to add a constraint CONT_NAME1
: t2 references T1(att1) ;

(Then I want to destroy those 2 tables)

I want to destroy the table T1 first : DROP TABLE T1 CASCADE ;

But it say to me : "Impossible to delete that index or table. It's the
current index or an index used in a relation." (translated from the
french version)

(I haven't added any Index right now.)

So my table isn't deleted !!

It only work if I destroy T2 first and then T1

It's my foreign key that block the delete... My query are
automatically generated so I need to destroy the table in that order
(T1 first and then T2).

Is there a way to drop every constraints using T1 (like : CONT_NAME1)
when dropping T1 (note : in my program, when I drop T1 I'm not able to
know if there is a constraint) ?

like in oracle with DROP TABLE T1 CASCADE CONSTRAINTS ?

Thanks for helping me

kahriboo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top