create table a(a number(10));
insert into a values (9876543245);
insert into a values (9876543345);
insert into a values (9876643345);
commit;
set echo off head off feedback off
set trim on trims on termout off
set line 32767 pages 0
spool a.txt
select to_number(substr(trim(to_char(a,'xxxxxxxxxx')),1,3)||substr(trim(to_char(a,'xxxxxxxxxx')),-2),'xxxxxxxxxx') d10 from a;
spool off