Insert single value set into multiple rows

I am not sure how to ask this question and it might be basic but I have a single set of values


"Date & Time","Computer","IP Address","MAC Address","Folder Or Server IP","Packet Length","Write Speed","Read Speed","Notes"
"10-18-2011 at 09:42:49","DCX","10.10.10.142","00-00-00-00-58-00","server","1,000,000 × 1","6.4770640 Mbps","2.5086320 Mbps",""

I need to insert these values into MySql where a Table exists but each value would be a separate insert statement.
LVL 1
SourceminerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kevin CrossChief Technology OfficerCommented:
Just for clarity, what should the final data in the table look like (i.e., post the destination table structure and expected rows after the above INSERT is complete).

Remember, you can INSERT multiple rows like:
INSERT INTO tablename(<column list>)
SELECT <column list> UNION ALL
SELECT <column list>;

Or:
INSERT INTO tablename(<column list>)
VALUES(<value list>);
INSERT INTO tablename(<column list>)
VALUES(<value list>);

Or:
INSERT INTO tablename(<column list>)
VALUES(<value list>), (<value list>);

But it really depends on your exact output need and source of the data being inserted.
0
PranjalShahCommented:
I am not sure why you want multiple insert statements for this...simple insert

INSERT INTO table_name (col_name1,col_name2,...,col_name10) VALUES (value1,value2,...,value10)

if just one per insert then,,

INSERT INTO table_name (col_name1) VALUES (value1)
0
Kevin CrossChief Technology OfficerCommented:
I agree. I figure it might be an entity-attribute-value table, which is why I asked for structure as that would impact how the final solution is actual derived as typically those require the same entity id for all rows, which needs to be gathered from the insert of the entity itself.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

SourceminerAuthor Commented:
Sorry as I was writing Its hard to put into words, (thanks for the fast response too)

Let me try again,
The destination table contains 3 Fields
ID, ExtraFieldID, Value

The Command I run exports a log of data in CSV format (as outlined above)

I am really only looking for the 2 values to be inserted into the destination table
,"6.4770640 Mbps","2.5086320 Mbps",

However they need to individually be inserted
IE: Insert into tablename SET ID=AUTO, ExtraFieldID=533, Value=(one of the 2 items)
Followed by another insert with the second value.

Thinking it might need to be inserted as a temp table?

0
Kevin CrossChief Technology OfficerCommented:
This may be helpful:
http://www.experts-exchange.com/Database/MySQL/A_3622-A-MySQL-Tidbit-In-line-CSV-Parsing.html

It has links to non-XML options. Additionally, you will see how to load the CSV in the first place using LOAD DATA INFILE. Using this method, you can insert both values at once with the INSERT INTO ... SELECT method I showed earlier.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SourceminerAuthor Commented:
Ended up taking this to a developer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.