title: MySQL Automatically Calculate IBAN bigint overflow
body: <p>this is my first question I am posting in stackoverflow, I hope, someone can help me. So far I could not find anyone asking a similar question here.</p>
  
  <p>I would like to check whether a German IBAN is correct. In principle, this is easy: You concatenate the Bank_number (8 digits) with the Account_Number (10 digits), the number equivalent to DE (1314 = 4 digits) and a check number (2 digits), then you calculate the modulo division and the result should be 1.</p>
  
  <p>Here is the code I enter into MySQL:</p>
  
  <pre><code>SELECT MOD(500105175404777100131451,97) as a
       , MOD(CONVERT(CONCAT("50010517","5404777100","1314","51"), UNSIGNED),97) as b
       , CONVERT(CONCAT("50010517","5404777100","1314","51"), UNSIGNED) as c
  </code></pre>
  
  <p>And here is the result I get from MySQL:</p>
  
  <pre><code>a   b    c
  1   60   18446744073709551615
  </code></pre>
  
  <p>As you can see, when I enter the entire number manually, I get the correct result (1), but when I try to construct the number from the separate strings (in this format they are so far saved in the database), the modulo division does not work because the string is incorrectly transformed to a number.</p>
  
  <p>Can anyone tell me what the problem could be?</p>
  
  <p>I tried "BIGINT" instead of "UNSIGNED" but then got the error</p>
  
  <pre><code>"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB
  server version for the right syntax to use near 'BIGINT"
  </code></pre>
  
  <p>Any help would greatly be appreciated.</p>
  
  <p>Thanks
  Stephan</p>