CREATE OR REPLACE FUNCTION dec2oct (N in number) RETURN varchar2 IS octval varchar2(64); N2 number := N; BEGIN while ( N2 > 0 ) loop octval := mod(N2, 8) || octval; N2 := trunc( N2 / 8 ); end loop; return octval; END dec2oct; / SQL> SELECT dec2oct(44978) FROM dual;
DEC2OCT(44978) -------------- 127662
Nenhum comentário :
Postar um comentário