Can you create functions in SQLite like you can in MSSQL?
If so, how? What is the syntax?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SQLite does not have a stored function/stored procedure language. So
CREATE FUNCTIONdoes not work. What you can do though is map functions from a c library to SQL functions (user-defined functions). To do that, use SQLite’s C API (see: http://www.sqlite.org/c3ref/create_function.html)If you’re not using the C API, your wrapper API may define something that allows you access to this feature, see for example:
sqlite_create_function()(http://www.php.net/manual/en/function.sqlite-create-function.php)sqlite3.create_function()(http://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.create_function)$dbh->sqlite_create_function($name,$argc,$code_ref,$flags)(https://metacpan.org/pod/DBD::SQLite#$dbh-%3Esqlite_create_function(-$name,-$argc,-$code_ref,-$flags-))