phpbar.de logo

Mailinglisten-Archive

Re: Felder aendern
Archiv Mailingliste mysql-de

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Felder aendern



Hi Frank

Habe in der Doku folgendes gefunden:
[beim ALTER TABLE (manual.html#ALTER_TABLE)]

<snip>
You can rename a column using a CHANGE old_col_name create_definition
clause. To do so, specify the old and new column names and the type that
the column currently has. For example, to rename an INTEGER column from
a to b, you can do this: 
     mysql> ALTER TABLE t1 CHANGE a b INTEGER;

- If you want to change a column's type but not the name, CHANGE syntax
still requires two column names even if they are the same. For example: 
 mysql> ALTER TABLE t1 CHANGE b b BIGINT NOT NULL;

- However, as of MySQL 3.22.16a, you can also use MODIFY to change a
column's type without renaming it: 
 mysql> ALTER TABLE t1 MODIFY b BIGINT NOT NULL;

- If you use CHANGE or MODIFY to shorten a column for which an index
exists on part of the column (for instance, if you have an index on the
first 10 characters of a VARCHAR column), you cannot make the column
shorter than the number of characters that are indexed. 
- When you change a column type using CHANGE or MODIFY, MySQL tries to
convert data to the new type as well as possible. 
<snap>

Grüessli, Johannes

"F.Augustin" wrote:
> 
> Guten Abend ,
> 
> wenn ich ein Feld in MySql als text definiert habe, kann ich das ohne
> Datenverlust in ein longtext aendern ?
> In der Tabelle stehen schon Daten drin und ich moechte die ungerne
> verlieren.
> 
> Finde leider nix in dem Manual dazu oder ich hab es ueberlesen ..
> 
> Fuer jede Hilfe waere ich dankbar ...
> 
> MfG
> 
> Frank
> 
> ---
> *** Abmelden von dieser Mailingliste funktioniert per E-Mail
> *** an mysql-de-request_(at)_lists.4t2.com mit Betreff/Subject: unsubscribe

---
*** Abmelden von dieser Mailingliste funktioniert per E-Mail
*** an mysql-de-request_(at)_lists.4t2.com mit Betreff/Subject: unsubscribe


Home | Main Index | Thread Index

php::bar PHP Wiki   -   Listenarchive