Re: Problems with psycopg2

2008-05-05 Thread c james
David Anderson wrote: 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(sel

Re: Problems with psycopg2

2008-05-03 Thread David Anderson
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

Problems with psycopg2

2008-05-01 Thread David Anderson
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 ge