|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, im working with perl and dbi.
Is there any select clause i can use to get the size of a field in bytes? Tnx in advance. |
|
#2
|
|||
|
|||
|
The byte size of a field generally depends upon the datatype of the column which you can find out with
SHOW COLUMNS FROM tbl_tablename; 1 byte: TINYINT, YEAR 2 bytes: SMALLINT 3 bytes: MEDIUMINT, TIME, DATE 4 bytes: INT, TIMESTAMP,FLOAT etc. string types are one byte per character plus one byte for the terminator (unless it's a multibyte character set). SELECT LENGTH (string); returns the number of characters. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Field size in bytes? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|