![]() |
sqlite3 question - execute method with :parameter - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: sqlite3 question - execute method with :parameter (/thread-18500.html) |
sqlite3 question - execute method with :parameter - richalt2 - May-20-2019 I see code using this syntax for the .execute and parameters passed with a dictionary. Where is this :parameter syntax defined? connection.execute("select * from :tab where :tab.fname = :firstname ", {"tab": peopletable, "firstname": onename} )I don't find this :parameter in any sqlite3 documentation? Is this dictionary string editing syntax a standard Python feature? RE: sqlite3 question - execute method with :parameter - Yoriz - May-20-2019 https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.execute Wrote:class sqlite3.Cursor RE: sqlite3 question - execute method with :parameter - woooee - May-20-2019 This is called named place holders http://zetcode.com/db/sqlitepythontutorial/ You can send a dictionary to a general lookup or add or delete function using named placeholders. |