|
From: markus j. <in...@mj...> - 2001-11-25 20:41:56
|
hello
I have the following code:
-----
db = PgSQL.connect("::proglang", user="markus", password="markus")
st = db.cursor()
st.execute("select * from languages")
print st.rowcount # prints -1
res = st.fetchall()
print st.rowcount # prints 3
for i in res:
print i
st.close
db.close
----
why does the first rowcount print "-1"????
shouldn't it print "3", as the second, which is the correct answer???
the db has three rows:
the complete output of the programm is:
-1
3
['Perl', 'Larry Wall', 'www.perl.com', 'better than C']
['Python', 'Guido von Rossum', 'www.python.org', 'very cool']
['Ruby', 'Yukihiro Matsumoto', 'www.ruby-lang.org', 'great']
is this a bug??
or is there something wrong with my understanding of rowcount??
markus
--
Markus Jais
http://www.mjais.de
in...@mj...
The road goes ever on and on - Bilbo Baggins
|