From 0a88f16411e177ce9f1bf76c2717110c0f0288d9 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 31 Jul 2012 20:24:44 -0400 Subject: [PATCH] A bit of an evil hack to get around a limitation in oursql? --- earwigbot/tasks/drn_clerkbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earwigbot/tasks/drn_clerkbot.py b/earwigbot/tasks/drn_clerkbot.py index a4fd89e..e815210 100644 --- a/earwigbot/tasks/drn_clerkbot.py +++ b/earwigbot/tasks/drn_clerkbot.py @@ -215,9 +215,9 @@ class DRNClerkBot(Task): def select_next_id(self, conn, column, table): """Return the next incremental ID for a case.""" - query = "SELECT MAX(?) FROM ?" + query = "SELECT MAX(?) FROM {0}".format(table) with conn.cursor() as cursor: - cursor.execute(query, (column, table)) + cursor.execute(query, (column,)) current = cursor.fetchone()[0] if current: return current + 1