⬅️ **[[Firebird DB]]**
***
# Firebird mit Python
### Installation of fdb
- [fdb](https://fdb.readthedocs.io/en/latest/)
- `pip3 install fdb` to install Python Moduele
- *If ERROR occurs:* `The location of Firebird Client Library could not be determined.`
- `sudo apt install libfbclient2` --> install Firebird Client Driver in Linux
### Example Python Connection to Firebird DB and SELECT Statement
```python
# Connection to DB
con = fdb.connect(
host='SERVER',
database=r'C:\Users\Public\Documents\Amicron-Data\MCE_Amicron_DB_Production_2022-02-08.FDB',
user='sysdba',
password='12345jklö',
charset='UTF-8'
)
# Create a Cursor object that operates in the context of Connection con:
cur = con.cursor()
# Execute the SELECT statement:
# sqlStecker contains an SELECT Statement Multiline String
cur.execute(sqlStecker)
# many was to output the results
# this one fetches all information -> cursor is getting empty after that
# Retrieve all rows as a sequence and print that sequence:
print(fdbCursor.fetchallmap())
```
##
***
Related:
- [[Python]]
- [[$-Software|Software]]