#!/usr/bin/env python3 # # vincent.hardy.be@gmail.com # # This script checks the proper working of the FDB library # # employee.fdb is a demo database supplied with each binary release of Firebird # (both windows and linux). # # Default Windows path : # C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\EMPLOYEE.FDB # # Default linux path : # /opt/firebird/examples/empbuild/employee.fdb import fdb con = fdb.connect( dsn='/var/firebird/employee.fdb', user='SYSDBA', password='masterkey' ) cur = con.cursor() cur.execute("Select \ FIRST_NAME,LAST_NAME,JOB_CODE \ from EMPLOYEE \ Where HIRE_DATE<'01-01-1991'") for row in cur: # python 3 print ('{} {} - {}'.format(row[0], row[1], row[2])) # python 2 # print '%s %s - %s' % (row[0], row[1], row[2])