![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Questions involving software not covered by other forum go here. This includes Databases and Middleware. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL article - Sun and MySQL: How It Stacks Up for Developers | iBot | UNIX and Linux RSS News | 0 | 02-28-2008 07:20 PM |
| MySQL conflicts with mysql-3.23.58-16.RHEL3.1 | johnveslin | Linux | 2 | 07-17-2007 03:49 AM |
| How to replace any char with newline char. | mightysam | Shell Programming and Scripting | 4 | 06-15-2006 04:46 AM |
| mysql would not start: missing mysql.sock | xnightcrawl | UNIX for Advanced & Expert Users | 2 | 05-26-2006 07:06 AM |
| MySQL problem >> missing mysql.sock | _hp_ | UNIX for Advanced & Expert Users | 8 | 11-03-2002 10:44 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Mysql CHAR vs VARCHAR
Looking for any advise from a DBA/DA. When should you use CHAR and when should you use VARCHAR when designing a table. From my readings seems like VARCHAR will accept any length string even though you define a length to it, so I setup gadget VARCHAR(10) I could actually put something with 20 characters in there. Thanks for any advise on this. Bill
|
| Forum Sponsor | ||
|
|
|
|||
|
RE: Mysql CHAR vs VARCHAR
Actually a VARCHAR(10) will only allow up to 10 characters and no more.
The main difference between CHAR and VARCHAR is how data is stored in the column. The length of a CHAR column is fixed and when CHAR values are stored, they are right-padded with spaces to the specified length. In contrast to CHAR, VARCHAR values are stored using only as many characters as are needed. Please see the MySQL docs for more details: MySQL AB :: MySQL 5.0 Reference Manual :: 10.4.1 The CHAR and VARCHAR Types Cheers! Nate |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|