int datatype

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

    #1

    int datatype

    Hi,

    In mySQL, I found the date type has smallint, int and bigint. What are their
    differences? I set a field with auto_increment as int type, what will happen
    when the number reaches to the limit? Thanks for any help.

    Atse


  • Aggro

    #2
    Re: int datatype

    atse wrote:
    [color=blue]
    > In mySQL, I found the date type has smallint, int and bigint. What are their[/color]

    http://www.mysql.com/doc/en/Numeric_types.html
    [color=blue]
    > differences? I set a field with auto_increment as int type, what will happen
    > when the number reaches to the limit? Thanks for any help.[/color]

    It will give you an sql error if you try to insert row while it can't
    put it there. You should always use types that are large enough. Also,
    use int unsigned if you are using auto_increment, because you don't need
    negative values and it will give you twice as much positive numbers.

    Comment

    • Aggro

      #3
      Re: int datatype

      atse wrote:
      [color=blue]
      > In mySQL, I found the date type has smallint, int and bigint. What are their[/color]

      http://www.mysql.com/doc/en/Numeric_types.html
      [color=blue]
      > differences? I set a field with auto_increment as int type, what will happen
      > when the number reaches to the limit? Thanks for any help.[/color]

      It will give you an sql error if you try to insert row while it can't
      put it there. You should always use types that are large enough. Also,
      use int unsigned if you are using auto_increment, because you don't need
      negative values and it will give you twice as much positive numbers.

      Comment

      • atse

        #4
        Re: int datatype

        Got it, thanks.

        "Aggro" <spammerdream@y ahoo.com> wrote in message
        news:uH7yb.354$ 3C3.173@read3.i net.fi...[color=blue]
        > atse wrote:
        >[color=green]
        > > In mySQL, I found the date type has smallint, int and bigint. What are[/color][/color]
        their[color=blue]
        >
        > http://www.mysql.com/doc/en/Numeric_types.html
        >[color=green]
        > > differences? I set a field with auto_increment as int type, what will[/color][/color]
        happen[color=blue][color=green]
        > > when the number reaches to the limit? Thanks for any help.[/color]
        >
        > It will give you an sql error if you try to insert row while it can't
        > put it there. You should always use types that are large enough. Also,
        > use int unsigned if you are using auto_increment, because you don't need
        > negative values and it will give you twice as much positive numbers.
        >[/color]


        Comment

        • atse

          #5
          Re: int datatype

          Got it, thanks.

          "Aggro" <spammerdream@y ahoo.com> wrote in message
          news:uH7yb.354$ 3C3.173@read3.i net.fi...[color=blue]
          > atse wrote:
          >[color=green]
          > > In mySQL, I found the date type has smallint, int and bigint. What are[/color][/color]
          their[color=blue]
          >
          > http://www.mysql.com/doc/en/Numeric_types.html
          >[color=green]
          > > differences? I set a field with auto_increment as int type, what will[/color][/color]
          happen[color=blue][color=green]
          > > when the number reaches to the limit? Thanks for any help.[/color]
          >
          > It will give you an sql error if you try to insert row while it can't
          > put it there. You should always use types that are large enough. Also,
          > use int unsigned if you are using auto_increment, because you don't need
          > negative values and it will give you twice as much positive numbers.
          >[/color]


          Comment

          Working...