OT: Insert brackets ( [ , ] ) into mysql table

Dylan Semler dylan.semler at gmail.com
Mon Nov 6 06:12:02 UTC 2006


On 11/5/06, Cameron Simpson <cs at zip.com.au> wrote:
>
> On 05Nov2006 09:26, Dylan Semler <dylan.semler at gmail.com> wrote:
> | > |  insert into objects (object, ID, `Spec.`) VALUES ('[mag]', '[mag]',
> '
> | > | with backslashes and backticks around the brackets.  Usually mysql
> juts
> | > | updates the table with a [, rather than [mag].  Anyone know how this
> | should | > | be done?
> | >
> | > Please show us "describe objects". Maybe your column types are
> | > restrictive?
> |
> | mysql> describe objects;
> | +---------------+---------+------+-----+---------+-------+
> | | Field         | Type    | Null | Key | Default | Extra |
> | +---------------+---------+------+-----+---------+-------+
> | | object        | char(1) | YES  |     | NULL    |       |
> | | ID            | char(1) | YES  |     | NULL    |       |
> [...]
>
> You can't fit a 5 character string into a 1 character column!


Ah, I suppose I should have caught that.  It may be obvious that I'm new to
mysql.  I created the columns with simply CHAR and didn't specify a
character length, hoping it would allow unlimited number of characters.  I
see now that it did the opposite.  Thanks for the help.

-- 
Dylan

Type faster.  Use Dvorak:
http://dvzine.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20061106/83eaef6e/attachment-0002.html 


More information about the users mailing list