MySQL Function to Convert Date To WordsKedarSeptember 16, 2010 Recently I saw a MySQL Stored Function requirement on Experts-Exchange for converting date into some specific words format. You may find MySQL function for date to words conversion online; even… View Post
4 responses to “MySQL Function to Convert Date To Words”
Hi is there any way to convert from words to date. any logic for this. I need know the date from Words Like: Twenty-third November Two Thousand should be : 23-11-2000 is it possible?
There are times when I have to ask myself – where is the most appropriate place to have logic reside. When it comes to converting numeric dates to words like this, it seems to me that this is something the database server should not be doing on enterprise-level servers. There are a lot of things that a MySQL server *can* do that it really should not attempt to do.
RDBMS’s are an expensive resource in most production environments while web and application servers tend to be far less expensive. Think about it this way – is it worth the extra processing on the database server as well as the extra memory that will be consumed by handling this processing there versus doing the same activity in a library that is shared on the application server, web server, or even better, on the client’s system? Would it be cheaper and potentially faster to do the extra work to implement the solution at some layer above the database? In this case, my guess is that it would be a lot cheaper to let the application code handle these transformations.
Note that MySQL does not pre-compile stored procedures at all so it will have to re-interpret the code in a stored procedure every time it’s called. That ain’t cheap. There may be a slight performance gain from caching, but I think you’ll find that an application can handle these transformations much more efficiently.
Well they’re slower as obvious differences between compiled sql and c code. 🙂
Check http://www.mysqlperformanceblog.com/2010/09/06/udf-vs-mysql-stored-function/
mysql stored function is much slower than ufds?