Solved

Can't open file

Posted on 2002-03-28
5
359 Views
Last Modified: 2008-03-03
creating a merged table with the following command within the events database.  The m2001_11 and m2001_12 tables are within the events table as well.

create table mergedArchiveTable (nsid varchar(10), utime int(10), eam_id bigint(20)) type=merge union=(m2001_12, m2001_11);

select * from mergedArchiveTable;

ERROR 1016: Can't open file: 'mergedArchiveTable.MRG'. (errno: 143)

Why is this occuring?
0
Comment
Question by:jerrykovach
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:andriv
ID: 6904961
Are you switching over to the database first:

\u events

Then the query

0
 

Author Comment

by:jerrykovach
ID: 6905542
database was switched over first.  
0
 
LVL 5

Accepted Solution

by:
andriv earned 200 total points
ID: 6905571
I never had to do a merge but in the manual it uses INSERT_METHOD=LAST, and it says if you don't specify it the inserts will return an error. (Hope it helps):

When you create a MERGE table you have to specify with UNION(list-of-tables) which tables you want to use as one. Optionally you can specify with INSERT_METHOD if you want insert for the MERGE table to happen in the first or last table in the UNION list. If you don't specify INSERT_METHOD or specify NO, then all INSERT commands on the MERGE table will return an error.

The following example shows you how to use MERGE tables:

CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20));
CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20));
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1");
INSERT INTO t2 (message) VALUES ("Testing"),("table"),("t2");
CREATE TABLE total (a INT NOT NULL, message CHAR(20), KEY(a)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6912966
Has this helped you, or is more needed?
Moondancer - EE Moderator
0
 

Author Comment

by:jerrykovach
ID: 6913968
I was able to solve this one on my own.  It seems that the merged tables have to have identical primary and key fields.  I had made a mistake in declaring one of those fields.  I shall give moon dancer credit since he had the closest answer.

Thanks guys.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question