On Thu, 1 Nov 2018 08:41:51 +0100 Clemens Ladisch <clem...@ladisch.de> wrote:
> > It strikes me that this would be nicer if sqlite offered this as > > an intrinsic capability. > > How would SQLite know what the table and column names are? When the SQL is loaded, it can be parsed and analyzed. SQLite could, if it chose, prevent dropping a table references by the stored SQL, or at least report on missing/obsolete pieces. But it need not do any more than it currently does with views. > How would that API be different from exec("SELECT SQL From StmtSQL > WHERE StmtName = ?")+prepare? Perhaps the least intrusive change would be to support special syntax in the prepare function. If the first word of the SQL is EXEC instead of insert/update/delete/select, look up the name in the procedure table, subsitute the retrieved text, and proceed per usual. Rather than inserting the SQL into a user-visible table, it might be preferable to support CREATE PROCEDURE. --jkl _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users