2
I have a hotel table and reserve table.
In the reserve table I have the primary key of the hotel table as foreign key.
I can’t truncate because there are relationships between keys. How can I?
I’ve already done:
truncate table hospede on delete cascade;
But I can’t.
Just remembering that the fk are with on delete cascade
. And that use version 11g express Edition.
If this doesn’t work, edit the question by providing column names and how relationships are defined.
– Victor Stafusa
I didn’t test why I deleted the constraints and truncated the table. If there was a way to force the truncate without so much lap, it would be ideal.
– André Nascimento
Constraints exist to ensure the integrity of tables, not using them you can do what you want but with risk. Apart from this it is often a simple matter of order in which the trucates or Deletes are made as said @Victor Stafusa.
– Motta