1

Topic: Operation with firebird under python

Somebody worked with library fdb for python?
I in basis firebird created the trigger:
CREATE OR ALTER TRIGGER DATE_VALUE_BI2 FOR DATE_VALUE
ACTIVE BEFORE INSERT POSITION 2
AS
BEGIN
post_event ' new_date ';
END
To receive notification messages as soon as in table DATE_VALUE the new data is added.
On python I use library fdb:
import fdb
our_pathDB ='D:\COUNTERS.FDB'#'D:\COUNTERS.FDB '/var/lib/firebird/2.5/COUNTERS.FDB/home/pi/kpu/COUNTERS.FDB
our_userDB ='sysdba'
our_passwordDB ='masterkey'
our_hostDB = ' 127.0.0.1'
con = fdb.connect (database=our_pathDB, host=our_hostDB, user=our_userDB, password=our_passwordDB, charset = ' WIN1251 ')
conduit = con.event_conduit ([' new_date '])
result = conduit.wait ()
print result
conduit.close ()
con.close ()
At start there is a following error:
Traceback (most recent call last):
File "H:///Analise_KPU/post_event.py", line 23, in <module>
result = conduit.wait ()
File "C:\Python27\lib\site-packages\fdb\fbcore.py", line 2088, in wait
raise ProgrammingError ("Event collection not initialized. It's necessary to call begin ().")
fdb.fbcore. ProgrammingError: Event collection not initialized. It's necessary to call begin ().
Exception AttributeError: "' EventConduit ' object has no attribute ' _EventConduit __ process_thread '" in <bound method Connection. __ del __ of <fdb.fbcore. Connection object at 0x01B35D30>> ignored
In what there can be a business?