Apr-18-2022, 12:12 PM
Trying to return column headers on a search and I truly do not know where to execute the dot command to make this work. The documentation just shows after the sqlite prompt, ie:: sqlite>.mode column. See below the two # lines of failed attempt.
What is the correct place and format for this command?
What is the correct place and format for this command?
def connect(self): self.con=sqlite3.connect(self.db_path) self.c=self.con.cursor() def abbr_res(self,cols,tblName,typee,order_by): #self.c.mode column #sqlite>.mode column self.c.execute(f"Select {cols} From {tblName} Order By {order_by}") cows=self.c.fetchall() return cows