moving out sql_function
Merge pull request #8 from nvcWilson/wil7