Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

from

 

(select

 

trunc(rupee/10000000) as crore,

 

(trunc(rupee/100000) - (trunc(rupee/10000000) * 100)) as lakh,

(rupee - (trunc(rupee/100000) * 100000)) as units,

 

paise as paise from

(select trunc(val1) as rupee, ((val1 - trunc(val1))*100)

 

as paise from

 

(select in_number as val1 from dual)));

 

return(out_word);

 

end;

 

 

 

 

 

Create or replace function needs a function name (user can assign reasonable name to suit to his logic interpretation and execution' Here We name our   function name as Num-2-word since  it converts numeric literals into word format' In the next line we need to give parameters within parenthesis with a word IN' (in-number IN Number)' Function will return a value and nature of return value type need to be mentioned and in this case it has been mentioned as return varchar2. The word "return" is the must'

Return variable should be named with data length here in this case it has been mentioned as OUT-WORD varchar2(1000) and return statement also has varchar2'