Changing datatypes

2002-09-19 Thread Mark Colvin

Can I change the data type of a column in a table from varchar(10) to
smallint(5) unsigned zerofill. The column that is set to varchar(10) is
populated with values from a primary key column in another table that has a
datatype smallint(5) unsigned zerofill and I need to make them both the
same. I administer my MySQL database from the command line and just need to
know
the syntax for changing data types. Also, can I do this without affecting
the data that is currently in the varchar(10) column (this data has came
from a column of the data type that I wish to change to)?



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: Changing datatypes

2002-09-19 Thread Egor Egorov

Mark,
Thursday, September 19, 2002, 12:24:45 PM, you wrote:

MC Can I change the data type of a column in a table from varchar(10) to
MC smallint(5) unsigned zerofill. The column that is set to varchar(10) is
MC populated with values from a primary key column in another table that has a
MC datatype smallint(5) unsigned zerofill and I need to make them both the
MC same. I administer my MySQL database from the command line and just need to
MC know
MC the syntax for changing data types. Also, can I do this without affecting
MC the data that is currently in the varchar(10) column (this data has came
MC from a column of the data type that I wish to change to)?

Yes, you can do it with ALTER TABLE .. MODIFY .. . If varchar(10) column
contains allowable values for SMALLINT(5) UNSIGNED ZEROFILL, there
shoudn't be a problem:
 http://www.mysql.com/doc/en/ALTER_TABLE.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Changing datatypes on the fly?

2002-03-11 Thread BD

At 02:59 PM 3/9/2002, you wrote:
I have a column defined as varchar(255) in my MySql-database. Now I 
realized that there's not enough room for my inserts. Is there any chance 
to change it's datatype to tinytext without making an entirely new 
database and inserting data from the old one to it?

-Jarkko
Jarkko,
 If you want something easier than ALTER TABLE, try MySQL Front, a 
MySQL GUI from http://www.anse.de/mysqlfront/. It's free and you're less 
likely to shoot yourself in the foot with it.g

Brent


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Changing datatypes on the fly?

2002-03-09 Thread Jarkko Toivonen

I have a column defined as varchar(255) in my MySql-database. Now I realized 
that there's not enough room for my inserts. Is there any chance to change 
it's datatype to tinytext without making an entirely new database and 
inserting data from the old one to it?

-Jarkko


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Changing datatypes on the fly?

2002-03-09 Thread Jeremy Zawodny

On Sat, Mar 09, 2002 at 10:59:52PM +0200, Jarkko Toivonen wrote:

 I have a column defined as varchar(255) in my MySql-database. Now I
 realized that there's not enough room for my inserts. Is there any
 chance to change it's datatype to tinytext without making an
 entirely new database and inserting data from the old one to it?

Sure, just use ALTER TABLE as described in the manual.

Jeremy
-- 
Jeremy D. Zawodny, [EMAIL PROTECTED]
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.47-max: up 30 days, processed 1,025,822,488 queries (391/sec. avg)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php