PgBoolean
| Newsgroups | gmane.comp.python.db.pypgsql.user,gmane.spam.detected |
|---|---|
| Message-ID | <20021120162314.LHAC13276.out019.verizon.net@[127.0.0.1]> |
Can anyone tell me how to programatically check the value of a PgBoolean object? I am doing the following:
#####
from pyPgSQL import PgSQL
from pyPgSQL import libpq
db = PgSQL.connect("localhost::testdb")
cursor = db.cursor()
cursor.callproc("sp_TestBoolean", 1, 1)
retval = cursor.fetchone()
#####
When I print the value of retval, I get this:
[<PgBoolean instance at 0x401c8900: Value: False>]
I would like to be able to do something like this:
if retval == true:
# do something
else:
# do something else
Thanks in advance for your help.
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing
your web site with SSL, click here to get a FREE TRIAL of a Thawte
Server Certificate: http://www.gothawte.com/rd524.html