0

mport sqlite3 from itertools import groupby

aes_fault_db = r'C:\Users\Desktop\Jetwave Cases\9V-SHD_20200313_0007\AES\Maintenance\AESFault_1.sqlite3'

def create_connection(aes_fault_db):

try:
    conn = sqlite3.connect(aes_fault_db)

except Error as e:
    print(e)

c = connection.cursor()
c.execute('SELECT recordid, record_type, modman_ticks, modman_date, modman_time, modman_power_on_counter,',
          'modman_flight_cycle_ounter, modman_latitude, modman_longitude, modman_altitude,',
          'modman_ground_speed, modman_aircraft_id, modman_flight_leg, L1_code, L2_code,',
          'L3_code, L4_code, L1_text, L2_text, L3_text, L4_text, additional_text,',
          'lru_recorded_temperature, lru_time, lru_antenna_azimuth, lru_antenna_elev * FROM aes_fault')
data = c.fetchall()
if data == None:
    print('no results for this query')
dataSize = c.rowcount
print(c.rowcount)
print(data)
for row in data:
    print(row)

c.close
Joe
  • 1
  • 1

1 Answers1

0

How can you not be getting errors? sqlite3 should be complaining that "function takes at most 2 arguments (5 given)". Every comma (,) in that long sql string delimits an argument. Enclose the entire sql with one set of """. That means removing all the single-quotes and line ending commas.

There is also a syntax error here lru_antenna_elev * FROM aes_fault'.

If you want all the columns from the table (*), then SELECT * from aes_fault is all the sql you need.

DinoCoderSaurus
  • 6,110
  • 2
  • 10
  • 15
  • hank you for the response. I had the line ending comas to wrap the single line to multiple in the editor. I attempted both of your recommendations and receive the same response: = RESTART: C:\Users\Desktop\Jetwave Cases\9V-SHD_20200313_0007\AES\Maintenance\Python_AES.py – – Joe Apr 22 '20 at 09:31