Solved

Can't open file

Posted on 2002-03-28
5
352 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
Comment Utility
Are you switching over to the database first:

\u events

Then the query

0
 

Author Comment

by:jerrykovach
Comment Utility
database was switched over first.  
0
 
LVL 5

Accepted Solution

by:
andriv earned 200 total points
Comment Utility
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
Comment Utility
Has this helped you, or is more needed?
Moondancer - EE Moderator
0
 

Author Comment

by:jerrykovach
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

7 Experts available now in Live!

Get 1:1 Help Now