Re: convert varchar to char

2005-08-16 Thread Jon Drukman
Pooly wrote: Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR colu

Re: convert varchar to char

2005-08-13 Thread Pooly
Yeah, for example the last statement ALTER, ..., ... is the only way sometimes to make things working. anyway, it's worth knowing it. 2005/8/13, Chris Elsworth <[EMAIL PROTECTED]>: > On Sat, Aug 13, 2005 at 05:37:56PM +0100, Pooly wrote: > > Damnit ! > > Thanks for pointing it, I forgot these

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 05:37:56PM +0100, Pooly wrote: > Damnit ! > Thanks for pointing it, I forgot these things. > But it's a bit more subtle : [snip] Bah, should have waited another 5 minutes before I bothered posting my last long-winded ramble ;) > ALTER TABLE sessions MODIFY id char(32) NOT

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 04:01:38PM +0100, Pooly wrote: > > ALTER TABLE sessions MODIFY ip char(8) NOT NULL DEFAULT '0'; > ALTER TABLE sessions MODIFY id char(32) NOT NULL DEFAULT ''; Hello, Since you have two varchar columns, I don't think there's any way to convert them both to char without dro

Re: convert varchar to char

2005-08-13 Thread Pooly
Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than

Re: convert varchar to char

2005-08-13 Thread Roger Baklund
Pooly wrote: Hi, I try to convert a varchar to a char, but it doesn't seems to work. From the manual: "...all CHAR columns longer than three characters are changed to VARCHAR columns." http://dev.mysql.com/doc/mysql/en/silent-column-changes.html > -- Roger -- MySQL General Mailing List F

convert varchar to char

2005-08-13 Thread Pooly
Hi, I try to convert a varchar to a char, but it doesn't seems to work. show create table sessions; CREATE TABLE `sessions` ( `id` varchar(32) NOT NULL default '', `user_id` int(6) NOT NULL default '0', `ip` varchar(8) NOT NULL default '0', `lastseen` timestamp NOT NULL default CURRENT_

Re: Why "VARCHAR" TO "CHAR" automatically when the length less than 4.

2004-08-24 Thread Martijn Tonies
> > > > I have a questions about "varchar columns" change to "CHAR columns" > > > > automatically. > > > > See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html > > > In addition to that - it doesn't really matter as the CHAR datatype > > isn't properly implemented in MySQL and behaves t

Re: Why "VARCHAR" TO "CHAR" automatically when the length less than 4.

2004-08-23 Thread Joseph Cochran
On Mon, 23 Aug 2004 15:25:21 +0200, Martijn Tonies <[EMAIL PROTECTED]> wrote: > > > I have a questions about "varchar columns" change to "CHAR columns" > > > automatically. > > See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html > In addition to that - it doesn't really matter as th

Re: Why "VARCHAR" TO "CHAR" automatically when the length less than 4.

2004-08-23 Thread Martijn Tonies
> > I have a questions about "varchar columns" change to "CHAR columns" > > automatically. > > See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR datatype isn't properly implemented in MySQL and behaves the same as the VARCHA

Re: Why "VARCHAR" TO "CHAR" automatically when the length less than 4.

2004-08-23 Thread Egor Egorov
Emi Lu <[EMAIL PROTECTED]> wrote: > I have a questions about "varchar columns" change to "CHAR columns" > automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by

RE: Why "VARCHAR" TO "CHAR" automatically when the length less th an 4.

2004-08-16 Thread Victor Pendleton
This is described here: http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html. The table is created as a fixed table format. -Original Message- From: Emi Lu To: [EMAIL PROTECTED] Sent: 8/16/04 3:20 PM Subject: Why "VARCHAR" TO "CHAR" automatically when th

Why "VARCHAR" TO "CHAR" automatically when the length less than 4.

2004-08-16 Thread Emi Lu
Hello all, I have a questions about "varchar columns" change to "CHAR columns" automatically. When I designed a table t1 create table t1(id varchar(3) not null) in MySQL. After that, we use "desc t1" to see the description of table "t1". The result is the following:

Re: varchar to char ...

2002-06-14 Thread Bhavin Vyas
TED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 3:55 PM Subject: RE: varchar to char ... > What do you mean by optimization of the column? Are you saying that > char takes less space than varchar or the performance on char is better > in queries

RE: varchar to char ...

2002-06-14 Thread vivek . chaudhary
bvyas3 > Subject: Re: varchar to char ... > > > Mysql optimizes the column type while creating the table. > > Regards, > Bhavn. > - Original Message - > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, June 14, 2002 2:26 PM

Re: varchar to char ...

2002-06-14 Thread Bhavin Vyas
Mysql optimizes the column type while creating the table. Regards, Bhavn. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 2:26 PM Subject: varchar to char ... > Hi guys, > > I have a query.I am not sure if this

varchar to char ...

2002-06-14 Thread vivek . chaudhary
Hi guys, I have a query.I am not sure if this is a bug or a feature (ha ha ha...). Table - abc name varchar(30), address varchar(50) Then I run this sql. create table temp_abc as select * from abc; datatypes of the columns changes: Table - temp_abc name char(30

Re: modifying varchar to char on the fly

2002-04-11 Thread Victoria Reznichenko
Description: e> When attempting to modify a column from varchar(40) to char(40) the command returns successfully, however the table is unaltered e> How-To-Repeat: e> (prepare a table table_name with a column column_name varchar(40) e> alter table table_name modify column_

modifying varchar to char on the fly

2002-04-10 Thread ensembl
e char(40) NOT NULL default ''; describe table_name >Fix: alternative right now is to drop the table and recreate it >Submitter-Id: >Originator: >Organization: IMCB, Singapore >MySQL support: none >Synopsis: altering table structure from v

Re: varchar to char in table with several varchar's

2001-12-12 Thread Paul DuBois
At 9:32 AM +0100 12/12/01, Willem Bison wrote: >I have a table with several columns of type 'varchar'. How can I change all >columns to fixed width char's ? Doing a 'alter' from varchar to char has no >effect since the column is changed back to varchar. You have

varchar to char in table with several varchar's

2001-12-12 Thread Willem Bison
I have a table with several columns of type 'varchar'. How can I change all columns to fixed width char's ? Doing a 'alter' from varchar to char has no effect since the column is changed back to varchar. ---