List:General Discussion« Previous MessageNext Message »
From:Miguel Vaz Date:January 1 2008 11:22pm
Subject:change field types from several tables
View as plain text  
	I am trying to import a big database of around 140 tables from xls 
to mysql. It works fine using navicat mysql, but i am running into a problem:

	Navicat tries to predict the field types, but makes a mistake on 
long text fields whose type needs to be "text", instead it makes them 
varchar(255), which is not enough for the content.

	I can solve the issue if i manually choose all field types to be 
"text", but since mysql has the alter table command to change field 
type, i was wondering if there is a way to change all fields from all 
tables to "text" automatically. This way i could import the table 
structure first, change all fields to type "text" and import tha data 
afterwards (the import is for an intermediary process, so no worries 
on all fields being "text" at this point).

	Something like:


	But obviously this doesnt work.

	Is this even possible using MYSQL? I could do it programmatically 
using PHP, i guess, but a single command would be far better. :-)

	Miguel Vaz

change field types from several tablesMiguel Vaz2 Jan
Re: change field types from several tablesBaron Schwartz2 Jan