0
I’m doing a script in Python accessing Sqlite database. I made a loop for but don’t know how to get the value of a column in the table.
Take the example:
cursor2 = cnx.cursor()
cursor2.execute("select * from despesas")
cursor2.moveToFirst()
cont = 0
lista = []
for (despesa) in cursor2:
if permanente="S":
elif:
I need to verify that the value of the "permanent" column of the "expenses" table is "S" or "N". The "permanent" column is varchar(1). Then I’m switching to Boolean. How do I do?
Thanks. Already helped a lot. Now I want to use the value of other columns to create a record in another table. So I used *. see below: if expense[permanent]="S": Elif: list.append(expense) ydespesa = [Expense] yvencing = [Maturity] yvalor = [Value] cursor3=cnx.cursor() cursor3.execute("INSERT INTO VALUES payments(null,ydespesa,yvencing,yvalor,null,null,null)") cnx.commit()
– psalrod
Please edit your question and add this second question.
– Denis Callau