473,382 Members | 1,271 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,382 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 6911

<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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.