Created
May 19, 2012 19:17
-
-
Save mariuz/2732054 to your computer and use it in GitHub Desktop.
new fdb firebird driver example :execute insert statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ 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
https://pythonhosted.org/fdb/getting-started.html#installation