Hi all
I have this function:
def checkName(self, name):
        cur = self.conn.cursor()

        sql = "SELECT * from patient WHERE fn_pat = '" + name + "'"
        cur.execute(sql)
        rows = cur.fetchall()

        if rows == "[]":
            self.insert()

It seems to work fine, But I'm getting this exception:
psycopg2.ProgrammingError: current transaction is aborted, commands ignored
until end of transaction block
at: cur.execute(sql)

What's the problem?
thx

ps: fn_pat is the column of the db, name is the string passed in the
function parameter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to