>One of my VarChar fields in my MySQL DB isn't big enough so I need to expandALTER TABLE tablename change fieldname fieldname varchar(100) not null;>it. In light of this, could you please answer these queries:
>1) How do I expand the size of the field without affecting the actual data
>inside the field?
(no, having fieldname in there twice is not a typo. One is the old
field name and the other is the new one).
If it can't hold your data, does speed matter? If you can retrieve>2) As I like to try and keep things as tight as possible in the DB, is there
>any REAL differences between changing my VarChar field from it's current
>setting of 30 to 70 or 100? What I'm saying is, if I set it to 100 am I
>losing out on anything over setting it to 70, eg search speed, physical db
and process 100 records incorrectly per second, is that better than
processing 100 records correctly in 72 hours (the time needed to
fix the code)?
There may be differences *OUTSIDE* the database, such as the size of
buffers used to hold the contents of the field (in C or C++, for
example), and you should be doing length-checking on the input before
inserting it: that check needs to change. The width of HTML input
fields may also need to change.
There are some boundaries which do matter: I believe varchar can't
go over 255, at which point you need to switch to "text" or "longtext"
Gordon L. Burditt