PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > change field types from several tables
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
change field types from several tables

Réponse
 
LinkBack Outils de la discussion
Vieux 01/01/2008, 23h22   #1
Miguel Vaz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut change field types from several tables


Hi,

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:

ALTER TABLE * CHANGE * * TEXT

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

  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 12h54.


É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,08687 seconds with 9 queries