Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. [solved]The conversion of the nvarchar value overflowed an int column.

[solved]The conversion of the nvarchar value overflowed an int column.

Scheduled Pinned Locked Moved Database
comhelp
9 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chdboy
    wrote on last edited by
    #1

    This is the error

    com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of the nvarchar value '8737383838' overflowed an int column.

    I'm putting the value integer into bank account number column.

    statement.setString(10,acnotxtfield.getText());

    Using prepared Statement.

    S B 2 Replies Last reply
    0
    • C chdboy

      This is the error

      com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of the nvarchar value '8737383838' overflowed an int column.

      I'm putting the value integer into bank account number column.

      statement.setString(10,acnotxtfield.getText());

      Using prepared Statement.

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      the value that you are trying to convert is larger than the int can handle. I would suggest that you change the type to Big Int int, bigint, smallint, and tinyint (Transact-SQL)[^]

      Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

      C 1 Reply Last reply
      0
      • S Simon_Whale

        the value that you are trying to convert is larger than the int can handle. I would suggest that you change the type to Big Int int, bigint, smallint, and tinyint (Transact-SQL)[^]

        Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

        C Offline
        C Offline
        chdboy
        wrote on last edited by
        #3

        Thanks a lot .

        1 Reply Last reply
        0
        • C chdboy

          This is the error

          com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of the nvarchar value '8737383838' overflowed an int column.

          I'm putting the value integer into bank account number column.

          statement.setString(10,acnotxtfield.getText());

          Using prepared Statement.

          B Offline
          B Offline
          Bernhard Hiller
          wrote on last edited by
          #4

          chdboy wrote:

          bank account number

          No, a bank account number IS NOT a number. A number is something you do maths with. But what's the meaning of the sum of two bank account numbers? Consequently, use a textual respresentation, e.g. char(10).

          L G 2 Replies Last reply
          0
          • B Bernhard Hiller

            chdboy wrote:

            bank account number

            No, a bank account number IS NOT a number. A number is something you do maths with. But what's the meaning of the sum of two bank account numbers? Consequently, use a textual respresentation, e.g. char(10).

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            +5

            1 Reply Last reply
            0
            • B Bernhard Hiller

              chdboy wrote:

              bank account number

              No, a bank account number IS NOT a number. A number is something you do maths with. But what's the meaning of the sum of two bank account numbers? Consequently, use a textual respresentation, e.g. char(10).

              G Offline
              G Offline
              GuyThiebaut
              wrote on last edited by
              #6

              Exactly! Bank account numbers can start with a zero or even contain non-numeric characters.

              “That which can be asserted without evidence, can be dismissed without evidence.”

              ― Christopher Hitchens

              C 1 Reply Last reply
              0
              • G GuyThiebaut

                Exactly! Bank account numbers can start with a zero or even contain non-numeric characters.

                “That which can be asserted without evidence, can be dismissed without evidence.”

                ― Christopher Hitchens

                C Offline
                C Offline
                chdboy
                wrote on last edited by
                #7

                We have only numeric bank account numbers .

                Richard DeemingR J 2 Replies Last reply
                0
                • C chdboy

                  We have only numeric bank account numbers .

                  Richard DeemingR Offline
                  Richard DeemingR Offline
                  Richard Deeming
                  wrote on last edited by
                  #8

                  But they're still not numbers. As Bernhard said, you can't add two bank account numbers together.


                  "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                  "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                  1 Reply Last reply
                  0
                  • C chdboy

                    We have only numeric bank account numbers .

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #9

                    chdboy wrote:

                    We have only numeric bank account numbers

                    The fact that they have numeric digits does not make them numbers. A street address has numeric digits but that doesn't make it a number.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups