Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Problems in que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15451 of 16112
Post > Topic >>

Problems in queries

by zerty.david@[EMAIL PROTECTED] ("David Anderson") May 3, 2008 at 08:05 PM

------=_Part_8386_19636546.1209855930725
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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...

------=_Part_8386_19636546.1209855930725
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all<br>I have this function:<br>&nbsp;def checkNameDob(self, name,
dob):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cur =
self.conn.cursor();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sql = &quot;SELECT * from
patient WHERE fn_pat =
%s&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cur.execute(sql,(name))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rows = cur.fetchall()<br><br>It
seems to work fine, But I&#39;m getting this
exception:<br>psycopg2.ProgrammingError: current transaction is aborted,
commands ignored until end of transaction block<br>
at: cur.execute(sql)<br><br>What&#39;s the problem?<br>thx<br><br>ps:
fn_pat is the column of the db, name is the string passed in the function
parameter.<br>if I type:<br>&quot;SELECT * from patient WHERE fn_pat =
&#39;david&#39; &quot;<br>
in the psql on console it works well...<br>

------=_Part_8386_19636546.1209855930725--
 




 2 Posts in Topic:
Problems in queries
zerty.david@[EMAIL PROTEC  2008-05-03 20:05:30 
Re: Problems in queries
aklaver@[EMAIL PROTECTED]  2008-05-03 17:02:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 20 4:13:09 CDT 2008.