I believe that, as the 32 byte string you see is the textual encoding of a 128 bit (16 bytes) binary string, it will consistently hold the same length no matter what the binary content will be.
About CHAR or VARCHAR, it depends. It's usually better to use a CHAR because in most implementations a VARCHAR will require one more page fetch per string read because VARCHAR data will be stored in a separate disk table, but if you plan to access one row at a time and you will fetch that row from an index seek, the performance cost will be quite small anyway. On the other side, I would not routinely query a one million row database with a LIKE statement on a VARCHAR.... :-)
A number of SQL implementations (mySQL for one) don't support mixed CHAR / VARCHAR fields in the same row, so if you change one field to VARCHAR all other CHARs will be converted to VARCHAR. So beware!
Please note that whether you say CHAR(32) or VARCHAR(32), only the first 32 chars will be stored in the database.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.