Google Answers Logo
View Question
 
Q: Moving data from an unstructured database to a structured one ( No Answer,   2 Comments )
Question  
Subject: Moving data from an unstructured database to a structured one
Category: Computers
Asked by: superdude264-ga
List Price: $10.00
Posted: 12 Jul 2006 01:11 PDT
Expires: 11 Aug 2006 01:11 PDT
Question ID: 745526
I have two databases in MySQL.  One has all the data I need but it is
all in varchar format.  Another has the table structure I want, but is
empty.  I have tried using phpMyAdmin to export just the data from the
first table into the second but I get an error when the program tries
to insert data into the first non-varchar part of the second table (an
enum field).  The question: how do I move the data in an all varchar
database to one that has other field types (varchar, enum, tinyint)
automatically
Answer  
There is no answer at this time.

Comments  
Subject: Re: Moving data from an unstructured database to a structured one
From: krell-ga on 12 Jul 2006 13:45 PDT
 
A two step process may work for you.  First export your data to a
plain old ASCII text file (which has no typed variables).  Next,
import the data from the temporary ASCII text file into the other SQL
database with your desired table structure.
Subject: Re: Moving data from an unstructured database to a structured one
From: njovin-ga on 04 Aug 2006 17:28 PDT
 
I would also try creating a backup copy of the database WITH the data,
and just changing the vartypes on all of the fields.  You may end up
losing some data, but it might do the trick.

Short of that, you could script it with something like PHP and let the
PHP script all of the data tye conversion to make the structured
database swallow the mis-categorized data.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy