Firebird statements no error but no result

85 views Asked by At

Running Firebird on my Raspberry Pi at the moment and using FlameRobin to control it. With another Raspberry Pi I want to some statements to it, I don't get any error codes but the data just doesn't get there.

import RPi.GPIO as GPIO
import time
import fdb

con = fdb.connect(dsn='10.100.2.197/3050:/home/trainee2/Desktop/ice', user='sysdba', password='trainee')

text_file = open("namen1.txt", "r")
lines = text_file.read().split(',')
namen = lines
text_file.close()
status = [0] * 12
indexSpatie = 0

pinnen = [18,23,24,25,20,21,17,27,6,13,19,26]
controlepin = [1] * 12
GPIO.setmode(GPIO.BCM)
for p in range(0,12):
    GPIO.setup(pinnen[p],GPIO.IN)
    print pinnen[p]

cur = con.cursor()

while True:
for e in range(0,12):
    status[e] = GPIO.input(pinnen[e])
    if (status[e] != controlepin[e]):
        n = e

        naam = str(namen[n])
        indexSpatie = naam.index(' ')
        voornaam = naam[:indexSpatie]
        achternaam = naam[indexSpatie:]
        stat = str(status[n])
        datum = time.strftime("%d/%m/%Y")

        print( voornaam + achternaam  + " met pinnummer: " + str(pinnen[n]) + " heeft status van " + stat + " op vandaag: " + datum)
        cur.execute("insert into ICEDATA (PRENAME, NAME, DATUM) values(?,?,?)",(voornaam,achternaam,datum))
        controlepin[e] = status[e]
time.sleep(1)

I post the whole code cause I don't see anything wrong with the statement and connection itself.

1

There are 1 answers

0
Ynias Reynders On

Like @ain said, forgot the commit statement on the connection

    con.commit()