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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/5/06, Cameron Simpson <cs@xxxxxxxxxx> wrote:
On 05Nov2006 09:26, Dylan Semler <dylan.semler@xxxxxxxxx> 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

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux