Problems in queries

Поиск
Список
Период
Сортировка
От David Anderson
Тема Problems in queries
Дата
Msg-id 5dc598e30805031605p700a9f64x16a66782abef2dc8@mail.gmail.com
обсуждение исходный текст
Ответы Re: Problems in queries
Список pgsql-general
Hi all
I have this function:
 def checkNameDob(self, name, dob):
        cur = self.conn.cursor();
     
        sql = "SELECT * from patient WHERE fn_pat = %s"
        cur.execute(sql,(name))
        rows = cur.fetchall()

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.
if I type:
"SELECT * from patient WHERE fn_pat = 'david' "
in the psql on console it works well...

В списке pgsql-general по дате отправления:

Предыдущее
От: Rainer.Zaiss@bondy.ird.fr
Дата:
Сообщение: output array elements in rows
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Problems in queries