How to Import Existing Data into a Relationship Split Table

Asked 1 years ago, Updated 1 years ago, 50 views

Thank you for your continuous support.

This time, we are looking for a way to import existing data into a table divided into relationships.

Currently, I try to combine programs using OR mapper to convert and import them, but it's troublesome to set up programs every time.
Is there any good way?

I mean, what do you do at times like this?

When importing Excel data into the database.

mysql

2022-09-30 20:30

1 Answers

Trends of "I want to know the list of Xs" and responses on other sites may fall under the category of "Answer with questions and expect other answers."Ento♦, thank you for your comment.

I think this problem is ultimately caused by the following complications:

  • It's troublesome to create a schema.
  • Foreign key linking is troublesome.
  • It's troublesome to write code in OR/M just for import

For the time being, let's proceed with the above assumption.
You may want to reconsider what is causing the problem and repost it.

If you can create the final stored data on EXCEL (including relationship key values)
Integer, String, Integer
id,name,age
1,ISHII,33
It would be easier to create a CSV like this and write a program that converts it.Alternatively, you can access MySQL via ODBC from the VBA.

There is also http://www-jp.mysql.com/why-mysql/windows/excel/ (MySQL for EXCEL). I've never used it before, so I can't say anything about it (I checked it lightly).table creation and schema updates).

Table schema (CREATE TABLE) may be troublesome, but
First, toss the MySQL storage engine into the table specified in CSV.
It's also a good idea to finish with just SQL.
After importing, add a user_id or something to associate with, and
UPDATE t1,t2SET t2.user_id t1.id WHERE...
Why don't you do something like that?

Abbreviated description.

If you can't trust the data entered in EXCEL and want to verify the data... I think it's 50 steps and 100 steps by any means.


2022-09-30 20:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.