M
Martin Doering
Hi!
I want to use Jython to fetch exactly one value from a database query,
like here:
# execute a query
def query(db, sql):
c = db.cursor()
c.execute(sql)
for line in c.fetchall():
val = line
print val
c.close()
return val
I could find out, how to create a tuple with just one member, but I
can not find out how to get a value from a tuple with just one member.
It will be an easy answer, I think. Sorry, it all is totally new for
me.
I want to use Jython to fetch exactly one value from a database query,
like here:
# execute a query
def query(db, sql):
c = db.cursor()
c.execute(sql)
for line in c.fetchall():
val = line
print val
c.close()
return val
I could find out, how to create a tuple with just one member, but I
can not find out how to get a value from a tuple with just one member.
It will be an easy answer, I think. Sorry, it all is totally new for
me.