Menu

[r2]: / OpenSessame / trunk / src / postgresql-connect.py  Maximize  Restore  History

Download this file

12 lines (10 with data), 375 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# -*- coding: utf-8 -*-
import psycopg
dsn = "host=localhost dbname=clocks user=mmaglis password=magliver"
conn = psycopg.connect(dsn)
curs=conn.cursor()
#curs.execute("insert into transactions values('54321', '123456789123'")
#conn.commit()
curs.execute("begin work;declare crs cursor for select * from transactions")
curs.execute("fetch 1 from crs")
print curs.fetchall()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.