|
Nope. I was resolving to add a "if there was an error, try DELETE FROM" after all truncates.What's kind of interesting is something I learned relatively recently: if you are deleting a sufficiently large number of records using DELETE FROM (with no WHERE clause), then the system actually tries to clear the file (equivalent to, or perhaps even identical to, CLRPFM).
For you, with only a few hundred records per file, you're definitely below the threshold for clearing. (In my experiments, I never saw the clearing behavior for less than 1000 records.)
Most annoyingly, truncating an empty table is also considered as an error condition. Note that I'm using ODBC from Linux to access the databases, and the (to me) only reliable way to tell if there was an error is to not look at affected row count, or return value, but see if the Error-method from Perl-DBI returns some text.I was so happy when TRUNCATE was added, but in practice, it virtually never works for me.
For me, the only *truly* reliable way to know if a truncate worked is to query the file to see if it is indeed empty.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.