At 12:20 PM 11/21/2007, you wrote:
mos wrote:
Jerry,

Does TRUNCATE work on a merge table?
Apparently not.
I tried:
"truncate table mymergetable" and got:
Error Code : 1
Can't create/write to file '.\dbname\mymergetable.MRG' (Errcode: 17)
I even tried a Flush Tables before the truncate and that didn't help.
So it looks like I'll have to truncate each individual table which is a pain because the merge table definition may change.
Mike

Since inserts can only go into the first or last table listed in the UNION option, this appears to be a misuse of merge tables. Why would you want a bunch of empty and unwritable tables hanging around? Why would you want them included in the merge table definition?

Gerald,
I have historical data that gets imported into 20 tables, 1 table per year, Table1987 to Table2007 for example. I have a program that imports the data into each table explicitly, like Table2007. In other words I don't add data to the merge table but instead I add it to its underlying tables. For queries I need to select a particular product code for all years and that's where the merge table comes in handy. I occasionally need to empty the tables that make up the merge table when I need to re-import all of the data from an external file. I want to make sure all the tables are empty before the data is imported.

Mike
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to