Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can't open file

Posted on 2002-03-28
5
Medium Priority
?
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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