zerofill error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotVeryBright

    #1

    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),Sur name 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



  • noone

    #2
    Re: zerofill error

    NotVeryBright wrote:
    [color=blue]
    > Hello
    > I'm trying to create a table as below
    > CREATE TABLE MyTable (ID FLOAT NOT NULL PRIMARY KEY ZEROFILL, Forename
    > VARCHAR(30),Sur name 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[/color]


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

    From the DOCS:[color=blue]
    >http://dev.mysql.com/doc/refman/5.0/...-overview.html[/color]

    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.








    Comment

    • NotVeryBright

      #3
      Re: zerofill error

      Thanks Noone,
      Tried it out works fine
      Thanks very much
      and Best regards




      Comment

      Working...