The thing is this query works fine on the console through psql, but not in
my code? can anyone explain me why?

On Thu, May 1, 2008 at 9:31 PM, David Anderson <[EMAIL PROTECTED]>
wrote:

> 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