title: Increase MAC-Address by 1
body: <p>I need to increment a hexadecimal number (MAC-Address) by 1.</p>
  
  <p>For example, I have a MAC-Address in such format:</p>
  
  <pre><code>00:A1:2C:3B:99:1F
  </code></pre>
  
  <p>And I need to increase this value by 1 and save the new value in the same format:</p>
  
  <pre><code>00:A1:2C:3B:99:20
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>UPDATE Info
  SET MAC = HEXTORAW(TO_CHAR(
                       TO_NUMBER(SUBSTR(RAWTOHEX(MAC), 1, 20), RPAD('x', 20, 'x')) + 1,
                       RPAD('fm0', 22, 'X')
                  )
                  || SUBSTR(RAWTOHEX(MAC), 21))
  WHERE ID = '';
  </code></pre>