Convert number to word in oracle sql
Get via App Store Read this post in our app!
How to convert number into words using sql
I need to convert date into words using sql , is it possible
I want to know why are we using 'j' and 'jsp in this query.
The TO_DATE (2, 'j') converts the number "2" into an Oracle DATE datatype, using the Julian format. This gives you the date January, 02 4713 BC.
The TO_CHAR( . 'jsp' ) converts that Julian date back to an integer and the "sp" means "spell out the number".
It seems the spelling-out isn't available unless you're converting a datetime to a string.
If you look into the inner most part of the query to_date(:number,'j') the âjâ or J is the Julian Date (January 1, 4713 BC), basically this date is been used for astronomical studies.
So to_date(:number,'j') it take the number represented by number and pretend it is a julian date, convert into a date.
If you pass 3 to number, so it will convert date to 3rd Jan 4713 BC, it means 3 is added to the Julian date.
Now to_char(to_date(:number,'j'),'jsp'), jsp = Now; take that date(to_date(:number,'j')) and spell the julian number it represents