469,623 Members | 883 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

zerofill error

Hello
I'm trying to create a table as below
CREATE TABLE MyTable (ID FLOAT NOT NULL PRIMARY KEY ZEROFILL, Forename
VARCHAR(30),Surname VARCHAR(30));
If I remove ZEROFILL it works ok
But with ZEROFILL I get and error (1064)
I've tried ZEROFILL in different places and I'm stumped.
Please help
Best regards and thanks in advance

Mar 13 '06 #1
2 2218
NotVeryBright wrote:
Hello
I'm trying to create a table as below
CREATE TABLE MyTable (ID FLOAT NOT NULL PRIMARY KEY ZEROFILL, Forename
VARCHAR(30),Surname VARCHAR(30));
If I remove ZEROFILL it works ok
But with ZEROFILL I get and error (1064)
I've tried ZEROFILL in different places and I'm stumped.
Please help
Best regards and thanks in advance

Try:
CREATE TABLE MyTable (ID FLOAT ZEROFILL NOT NULL PRIMARY KEY, Forename
VARCHAR(30),Surname VARCHAR(30));

From the DOCS:http://dev.mysql.com/doc/refman/5.0/...-overview.html


FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]

A small (single-precision) floating-point number. Allowable values are
-3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to
3.402823466E+38. These are the theoretical limits, based on the IEEE
standard. The actual range might be slightly smaller depending on your
hardware or operating system.

M is the total number of decimal digits and D is the number of digits
following the decimal point. If M and D are omitted, values are stored to
the limits allowed by the hardware. A single-precision floating-point
number is accurate to approximately 7 decimal places.

If you specify ZEROFILL for a numeric column, MySQL automatically adds the
UNSIGNED attribute to the column.

UNSIGNED, if specified, disallows negative values.


Mar 13 '06 #2
Thanks Noone,
Tried it out works fine
Thanks very much
and Best regards


Mar 13 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Tony Wright | last post: by
3 posts views Thread by Khazret Sapenov | last post: by
7 posts views Thread by p | last post: by
2 posts views Thread by WebSnozz | last post: by
1 post views Thread by sonia.sardana | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.