473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how to import Excel file into an already normalized database?

Hi all,

I have a problem with the issue in the subject, i have all data in one
big excel file,
in a denormalized form, and on the other side, i have mysql database
with many tables, which is already in production, and it is of course
in the 3rd NF. How do i go about importing that excel file , is there
any good tool i could use to handle prim/foreign key issues for me?
Any advice appreciated!

Thanks

Jun 26 '06 #1
3 6913

<fk*****@gmail.com> wrote in message
news:11*********************@b68g2000cwa.googlegro ups.com...
Hi all,

I have a problem with the issue in the subject, i have all data in one
big excel file,
in a denormalized form, and on the other side, i have mysql database
with many tables, which is already in production, and it is of course
in the 3rd NF. How do i go about importing that excel file , is there
any good tool i could use to handle prim/foreign key issues for me?
Any advice appreciated!

Thanks

save the excel file as a csv file instead and import that
Jun 26 '06 #2

fk*****@gmail.com wrote:
Hi all,

I have a problem with the issue in the subject, i have all data in one
big excel file,
in a denormalized form, and on the other side, i have mysql database
with many tables, which is already in production, and it is of course
in the 3rd NF. How do i go about importing that excel file , is there
any good tool i could use to handle prim/foreign key issues for me?
Any advice appreciated!

Thanks


There are two options. The first is to convert the excel file to CSV,
import it into the database in its own table, then populate the
normalised table using INSERT INTO table VALUES ( SELECT ... FROM
excel_table WHERE ... ); This doesn't work too well if you're using
auto incremented keys to join the values, though.

The second option is to just bite the bullet and write your own import
utility. Perl excels at string manipulation and DB access, but any
language will do. This is the better route if:

a) You use automatically incremented primary key fields
b) The data you're importing is not brand new, but must be linked to
existing records
c) It's not possible to go with option 1 due to complexity / lack of
identifying informaiton in the excel file.

Regards,
Ian

Jun 26 '06 #3
Ian,

Thanks for your advice, I am aware that writing a script to import this
data was one solution, but i asked here, in hope that someone might
reveal some "GreatTool (TM)" that will do all the hard work for me, and
just let me specify what data goes to which table. I will continue my
search for the holy grail, and if anyone could help me on my quest, i
would greatly appreciate it!
Thx all
raisinodd wrote:
fk*****@gmail.com wrote:
Hi all,

I have a problem with the issue in the subject, i have all data in one
big excel file,
in a denormalized form, and on the other side, i have mysql database
with many tables, which is already in production, and it is of course
in the 3rd NF. How do i go about importing that excel file , is there
any good tool i could use to handle prim/foreign key issues for me?
Any advice appreciated!

Thanks


There are two options. The first is to convert the excel file to CSV,
import it into the database in its own table, then populate the
normalised table using INSERT INTO table VALUES ( SELECT ... FROM
excel_table WHERE ... ); This doesn't work too well if you're using
auto incremented keys to join the values, though.

The second option is to just bite the bullet and write your own import
utility. Perl excels at string manipulation and DB access, but any
language will do. This is the better route if:

a) You use automatically incremented primary key fields
b) The data you're importing is not brand new, but must be linked to
existing records
c) It's not possible to go with option 1 due to complexity / lack of
identifying informaiton in the excel file.

Regards,
Ian


Jun 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rcb845 | last post by:
Hi everybody in the php community, I am relatively new in this field, and one of my first challenge is the following : Importing an Excel file, containings URL, into a MySQL database. It...
8
by: Johnny | last post by:
I was looking for information on how to import an excel file or other text file into a MySql database. I have done this with both access and SQL Server and am looking for a way to do this in...
3
by: saurabh590 | last post by:
dear all, i want to import excel file in my database table. plz give me the whole coading. thanks and regards saurabh
5
by: sejal17 | last post by:
Hello Every one, I am trying to import excel file data in to mysql database table,the code for import excel file is working fine in local system but when i am testing it online webpage it display...
8
by: qfchen | last post by:
Hi, A piece of simple code to import excel file to a database, as shown below, I have problem when I tried to open the connection, the error message shows Excel driver is not correct. where shall...
2
by: jitendrawel | last post by:
how can be import excel file in mysql database through PHP code. Please send me complete code ASAP. Thanks. Best regards, Jitendra Kumar
5
by: sumanta123 | last post by:
Dear Sir, How to export/import the excel file in oracle database using sql promt. Please guide me the command(export/import) for the neddful. Thanks in Adavance. Regards Sumanta Panda
1
by: vikassawant | last post by:
Hi, I want to import Excel file data in JTable.For that I am using following Code, String excelFileName = "Team1.xls"; File file = new File(excelFileName ); //‘file’ is the file you...
1
by: orked | last post by:
i tried to import excel file into gridview but the code made this exception (Failed to map this path''xmlTest.xml") i don't know why my code: public void fillGrid() { DataSet ds =...
4
by: orked | last post by:
i want to import excel file to gridview but there was error(Failed to map this path "/xmltest.xml") and i couldn't handle it my code: public void fillGrid() { DataSet ds = new...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.