Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: truncate problem
Of course, the whole idea of whether or not
one can drop constraints to truncate a table
all revolves around what is going on at the
desired time of truncation...
Are other users logged in?
What is the purpose of the constraints?
Could any data be compromised by temporarily
dropping them?
Would any user be able to perform an action
during that time which would have been prevented
by a constraint?
etc, etc, etc.
If the answers are yes, or there is danger to the data, or even that you must merely "demonstrate" that the system "would be safe" then it will mean that dropping the constraints will be an unacceptable solution, no matter how easy and simple for the developer... Instead, one will have to write proper DELETE statements, etc... to "guarantee" that the business rules in the database would stay intact...
This was the case on my previous project...
a certain shop floor tracking system...
which was supposed to become 24 x 7.
Early on, truncates were used, but as we
became more experienced we began to ask
tougher questions of the vendor, like
"If the constraints are dropped, how do
you guarantee other users won't corrupt
the data during that time?..." Since they
had no good answer, we altered the process
to keep the constraints turned on all the
time..
Robert Proffitt
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 05 1999 - 12:51:14 CST