Flame has asked for the wisdom of the Perl Monks concerning the following question:
This is just a quick question, I have a string of binary values, (yes, i mean I have a string that looks like this: '010010110101001000101001000000100101110000000010') 357 characters long that I have to store in a mysql table. Now I have several posibilities for how to store it, and several problems with most of them.
My first choice would be a varchar field because that can be fixed-width, however those have a max length of 255, leaving Text as my shortest field type available.
Another possibility was the pack command, which seems to work, shortening it down to an easy-to-store 45 characters, however that creates other complications. In order to use this method, I need to find some way of at least simulating a unpack('B*',value) from within mysql.
To summerize, is there a pack/unpack command built in to mysql that could compress and de-compress my string, or is there some other method of making that many pieces of data fit into a 255 char space?
Sorry if this isn't as clear as it could be, if I need to clarify something, feel free to say so.
Thanks!
My code doesn't have bugs, it just develops random features.
Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MySQL pack?
by Zero_Flop (Pilgrim) on Apr 13, 2003 at 05:32 UTC | |
by diotalevi (Canon) on Apr 13, 2003 at 06:56 UTC | |
by Anonymous Monk on Apr 13, 2003 at 07:49 UTC | |
by diotalevi (Canon) on Apr 13, 2003 at 15:34 UTC | |
by Flame (Deacon) on Apr 14, 2003 at 02:51 UTC | |
|
Re: MySQL pack?
by Anonymous Monk on Apr 13, 2003 at 01:53 UTC | |
|
Re: MySQL pack?
by CountZero (Bishop) on Apr 13, 2003 at 15:23 UTC |