Insert NIB in the database

0

What kind of data is required to receive the Bank Identification Number (NIB) in a database?

The NIB consists of 21 digits.

I have tried but the following error appears:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'NIB' at row 1
    
asked by anonymous 22.10.2014 / 15:08

1 answer

5

The error is due to the fact that you are using a numeric type that does not have a dimension to contain this number. In addition, although the NIB consists only of numeric characters, it can not be represented by a numeric type because it may have digits 0 at the beginning.

So you will have to use a string type. As the number of characters is constant and known the choice is char(21) .

    
22.10.2014 / 15:26