PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.database.mysql > how to import Excel file into an already normalized database?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
how to import Excel file into an already normalized database?

Réponse
 
LinkBack Outils de la discussion
Vieux 26/06/2006, 16h22   #1
fkulaga@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Vieux 26/06/2006, 16h25   #2
Mike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to import Excel file into an already normalized database?


<fkulaga@gmail.com> wrote in message
news:1151331751.123495.76980@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


  Réponse avec citation
Vieux 26/06/2006, 21h42   #3
raisinodd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to import Excel file into an already normalized database?


fkulaga@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

  Réponse avec citation
Vieux 26/06/2006, 23h22   #4
fkulaga@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to import Excel file into an already normalized database?

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 me on my quest, i
would greatly appreciate it!
Thx all


raisinodd wrote:
> fkulaga@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


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h01.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09373 seconds with 12 queries