Changeset: 75648ce26d7d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=75648ce26d7d Modified Files: clients/examples/python/sqlsample.py.in Branch: Oct2012 Log Message:
sqlsample: fix syntax for Python 3 diffs (31 lines): diff --git a/clients/examples/python/sqlsample.py.in b/clients/examples/python/sqlsample.py.in --- a/clients/examples/python/sqlsample.py.in +++ b/clients/examples/python/sqlsample.py.in @@ -24,23 +24,23 @@ dbh = monetdb.sql.Connection(port=int(sy cursor = dbh.cursor(); cursor.execute('select 1;') -print cursor.fetchall() +print(cursor.fetchall()) cursor = dbh.cursor(); cursor.execute('select 2;') -print cursor.fetchone() +print(cursor.fetchone()) # deliberately executing a wrong SQL statement: try: cursor.execute('( xyz 1);') except monetdb.sql.OperationalError, e: - print e + print(e) cursor.execute('create table python_table (i smallint,s string);'); cursor.execute('insert into python_table values ( 3, \'three\');'); cursor.execute('insert into python_table values ( 7, \'seven\');'); cursor.execute('select * from python_table;'); -print cursor.fetchall() +print(cursor.fetchall()) s = ((0, 'row1'), (1, 'row2')) x = cursor.executemany("insert into python_table VALUES (%s, %s);", s) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list