title: How to convert integer to hex notation?
body: <p>Using: Firebird 2.5.3</p>
  
  <p>In a stored procedure (PSQL), converting a number from hex notation to decimal notation is done easily:</p>
  
  <pre><code>DECLARE VARIABLE I INTEGER;
  
  BEGIN
  
    I = CAST('0x0FFFE' AS INTEGER);  -- I will have the value 65534
  </code></pre>
  
  <p>How can the reverse be achieved? ie. Convert from decimal notation to hex notation?</p>