title: Replace each letter with it's ASCII code in a string in PL/SQL
body: <p>is a better, shorter way to preform this code:</p>
  
  <pre><code>/*Replace all letters by their respective ASCII code - 55*/
  as_iban := REPLACE(as_iban, 'A', '10');
  as_iban := REPLACE(as_iban, 'B', '11');
  as_iban := REPLACE(as_iban, 'C', '12');
  as_iban := REPLACE(as_iban, 'D', '13');
  as_iban := REPLACE(as_iban, 'E', '14');
  as_iban := REPLACE(as_iban, 'F', '15');
  as_iban := REPLACE(as_iban, 'G', '16');
  as_iban := REPLACE(as_iban, 'H', '17');
  as_iban := REPLACE(as_iban, 'I', '18');
  as_iban := REPLACE(as_iban, 'J', '19');
  as_iban := REPLACE(as_iban, 'K', '20');
  as_iban := REPLACE(as_iban, 'L', '21');
  as_iban := REPLACE(as_iban, 'M', '22');
  as_iban := REPLACE(as_iban, 'N', '23');
  as_iban := REPLACE(as_iban, 'O', '24');
  as_iban := REPLACE(as_iban, 'P', '25');
  as_iban := REPLACE(as_iban, 'Q', '26');
  as_iban := REPLACE(as_iban, 'R', '27');
  as_iban := REPLACE(as_iban, 'S', '28');
  as_iban := REPLACE(as_iban, 'T', '29');
  as_iban := REPLACE(as_iban, 'U', '30');
  as_iban := REPLACE(as_iban, 'V', '31');
  as_iban := REPLACE(as_iban, 'W', '32');
  as_iban := REPLACE(as_iban, 'X', '33');
  as_iban := REPLACE(as_iban, 'Y', '34');
  as_iban := REPLACE(as_iban, 'Z', '35');
  </code></pre>
  
  <p>The code above converts all the upper chars of the string to there respective ASCII code numbers. but this is not the correct way of going about it, but I can't figure out another way of doing it.</p>
  
  <p>I have tried something like</p>
  
  <pre><code>FOR i in 1..LENGTH(as_iban)
  LOOP
  select regexp_replace(as_iban,'['||substr(as_iban,i,1)||']', ASCII(regexp_substr(as_iban,'['||substr(as_iban,i,1)||']')) - 55) into as_iban FROM dual;
  END LOOP;
  </code></pre>