SQLite Forum

Request: stored functions/procedures
Login
Please add 'stored functions and procedures'. 

Yes, you can create an additional function in C, but that requires changing C code etc, as opposed to adding some SQL to a database.

Since 'triggers' are essentially stored functions, it *should* be doable to add functions.

To make them useful, you would also need to have user-defined variables.  Something like what I can do with MariaDB:

    CREATE FUNCTION joe(p1 CHAR(8)) RETURNS INTEGER
    BEGIN
      SELECT NULL into @result;
      ... SQL stuff ...
      RETURN @result;
    END;

I'm finding that feature (of MariaDB) incredibly useful and would like to see it adopted in SQLite as well, if possible