Database strings.



I use the MySql database. My question concerns the storage of character strings. I always use varchar for character strings and in my current program I specify 250 as the maximum length for all of my strings.

For some strings that large of a number is ridiculously long. Is there any disadvantage to using such a large number? Is my database wasting space somehow?

My book on MySql says that varchar uses one byte to store the length of the string. Does that mean that varchars are limited to 256 (or 255) characters? My book doesn't say. Perhaps does varchar allow longer strings using a different scheme.
.



Relevant Pages

  • Re: perl+varchar in informix and oracle
    ... Perl's undef) and values (represented by strings of the appropriate length). ... Same structure in oracle also, except that varchar is varchar2 ... the query you showed illustrates a bug in IDS. ...
    (comp.databases.informix)
  • ADO.NET C#: varchar() fields are padded with spaces on some records
    ... I'm reading a table with varchar() strings. ... For some reason this fields is ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: PHP / MSSQL
    ... i have a MS SQL Database with some tables with textfields. ... in the textfields are long strings ... ... the driver used by PHP only supports 255 characters in a varchar. ... text (the data type not the type of data) has a limit of 2^31-1 bytes. ...
    (comp.lang.php)
  • ORACLE/MSSQL casting question
    ... I just changed a column from int to varchar. ... what I want to do is change those values to strings ... I'm having a hard time trying to find the command to do this ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: LC_ALL and os.listdir()
    ... that file names are character strings. ... most *people* think that file names are character strings. ... the notion of a file system encoding. ... be converted to Unicode). ...
    (comp.lang.python)

Loading