G
G
Gleb Lukashonok2020-05-29 17:17:17
Python
Gleb Lukashonok, 2020-05-29 17:17:17

How to "climb" FireBird DB through Python?

Good afternoon! There is the following database (FireBird)
5ed114684d333812671858.png
How can I get into this EVENTS table through Python and print the data, let's say in print?
Wrote this:

import fdb
con = fdb.connect(dsn='DESKTOP-TVUF8FU:D:/Dev/Python/FireBird_test/GLOBALMZSH.FDB', user='sysdba', password='masterkey')
cur = con.cursor()
test = cur.execute("select * from EVENTS")
print (test)

Here's the mistake: I'm generally zero with the database, and I found nothing more about working with FireBird than how to create an empty database and add a table there. Please tell me how to extract data from this "mess". Thank you! <fdb.fbcore.Cursor object at 0x000002798F32E2B0>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-05-29
@Bombesko

Didn't work with FireBird, but you should probably use fetchall():

import fdb
con = fdb.connect(dsn='DESKTOP-TVUF8FU:D:/Dev/Python/FireBird_test/GLOBALMZSH.FDB', user='sysdba', password='masterkey')
cur = con.cursor()
cur.execute("select * from EVENTS")
test = cur.fetchall()
print (test)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question