chr(163) for £ pound character

Use chr(163) for the ‘£’ character, especially in stored SQL such as create procedure scripts, where you can’t be sure what client character settings might be used to re-create the procedure.

SELECT m.description, chr(163)||TO_CHAR(m.weekly_rate, '999.99') amount from my_table m;

This plsql gives the full list of ASCII codes:

set serveroutput on size 10240
declare
   i number;
   j number;
   k number;
begin
   for i in 2..15 loop
       for j in 1..16 loop
           k:=i*16+j;
           dbms_output.put((to_char(k,'000'))||':'||chr(k)||'  ');
           if k mod 8 = 0 then
              dbms_output.put_line(' ');
           end if;
       end loop;
   end loop;
end;
/

(From http://www.orafaq.com/wiki/ASCII )

June 8, 2010

Leave a Reply

Your email address will not be published. Required fields are marked *