MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 3rd, 2000, 10:46 AM
c1zorro c1zorro is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 1999
Posts: 3 c1zorro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old April 6th, 2000, 04:50 PM
underdog underdog is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: British Columbia
Posts: 11 underdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Field size in bytes?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT