0

I saw this question here Run the query saved in MS Access with required parameters through Pyodbc?

and wonder if this is also possible with a sqlite database and stored insert or update queries.

accpert.com
  • 109
  • 11
  • SQLite doesn't support things like stored procedures. The closest you get are views and triggers. – Shawn Jul 26 '21 at 08:11
  • ok, let's say I have a insert or update view with parameters stored in the sqlite database. how do I create the view with parameters and how do I call it from python? – accpert.com Jul 26 '21 at 10:32
  • "let's say I have a insert or update view with parameters stored in the sqlite database" - Please [edit] your question to show the SQLite DDL (e.g., `CREATE VIEW` or whatever) for the thing that you would be trying to execute. – Gord Thompson Jul 26 '21 at 12:44
  • we could take a simple update statement like "update customer set zipcode 5090 where city = #parameter# – accpert.com Jul 26 '21 at 13:12
  • related: https://stackoverflow.com/q/23089335/2144390 – Gord Thompson Jul 26 '21 at 18:25
  • Have you tried creating such a view? – Shawn Jul 26 '21 at 19:12
  • the link sent from gord is creating a new view. this here is a stored view like the one in the link in the question. – accpert.com Jul 26 '21 at 20:03
  • Are you talking about a view stored in the SQLite database itself, or a saved query in an Access database that points to a SQLite database (via ODBC)? – Gord Thompson Jul 27 '21 at 10:18
  • as in the header of the question stated its about a sqlite database. But so far i understood its not possible to save a view in sqlite that updates values on a tables – accpert.com Jul 27 '21 at 15:33

0 Answers0