#format python """ SQLQuery.py -- Copyright 2004 William Waites This program is Free Software and is released under the terms of the GNU General Public License. Please see http://www.gnu.org/licenses/gpl for the full text of the terms and conditions. This is an example macro that uses the results of the SQLConnect macro. Please see the accompanying SQLConnect macro for documentation. """ def execute(macro, args): if not hasattr(macro.request, "sql_cursor") or not macro.request.sql_cursor: print "Absent database connection" return cursor = macro.request.sql_cursor cursor.execute(args) print '
| ' + str(col) + ' | ' print '