Solved

Can't open file

Posted on 2002-03-28
5
356 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mySql Syntax 7 44
MySQL Error 3 39
What does "flush tables;" do exactly? 7 68
PHP loop not working 4 55
Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now