Skip to content

Instantly share code, notes, and snippets.

@h0rn3t
Forked from mariuz/execute_insert_statement.py
Created September 6, 2019 10:38
Show Gist options
  • Save h0rn3t/42297edb297ef81503d88ce52f55f5ec to your computer and use it in GitHub Desktop.
Save h0rn3t/42297edb297ef81503d88ce52f55f5ec to your computer and use it in GitHub Desktop.
new fdb firebird driver example :execute insert statement
# $ pip install fdb
# use this documentation for the moment http://www.firebirdsql.org/file/documentation/drivers_documentation/python/3.3.0/tutorial.html#connecting-to-a-database
import fdb as kinterbasdb
con = kinterbasdb.connect(dsn='/var/lib/firebird/2.5/data/rdbgraph.fdb', user='sysdba', password='masterkey')
cur = con.cursor()
# Execute the insert statement:
name="name"
facebook_id="facebook_id"
insert_query="INSERT INTO RDBGRAPH_NODES (NAME, FACEBOOK_ID,EMAIL,GOOGLE_ID,TWITTER_ID) VALUES ( ? , ?,'','','')"
cur.execute(insert_query,(name,facebook_id,))
con.commit()
cur.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment