PL/SQL Function to Accept Number and Display in Words

PL/SQL Function to Accept Number and Display in Words:



create or replace function ntw(no in number)
return varchar is n_t_w varchar(50);
c number;
str varchar(50);
begin
for i in 1..length(no)
loop
c:=substr(no,i,1);
select decode(c,0,'Zero',1,'One',2,'Two',3,'Three',4,'Four',5,'Five',6,'Six',7,'Seven',8,'eight') into str from dual;
n_t_w:=n_t_w||str;
end loop;
return(n_t_w);
end;

Leave a Reply

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

three × 1 =