Access DB - Table Name - EMPTBL
Coloumns Names
Sal(with Values),cca(No Values),Hra(No Values),NS(No Values),GS(No Values)
I want to calculate CCA HRA NS GS, based on sal(salary)
and update the table EMPTBL
Coloumns Names
Sal(with Values),cca(No Values),Hra(No Values),NS(No Values),GS(No Values)
I want to calculate CCA HRA NS GS, based on sal(salary)
and update the table EMPTBL
import pyodbc conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\MyPython\Mydb.accdb;') cursor = conn.cursor() Mysal= cursor.execute('select sal from EMPTBL') if Mysal > 5000: sql= """ Update EMPTBL SET sal=mysal*.25""" cursor.execute(sql) cursor.commit() conn.close()
Error:File "C:/MyPython/MyTest.py", line 9
sql= """ Update EMPTBL SET sal=mysal*.25"""
^
IndentationError: expected an indented block
Process finished with exit code 1