python newbie seeks advice on sybase.py

De Clarke <[email protected]>
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
dear all:  the Fearless (and Clueless) Python Newbie here trying to
understand the sybase module :-)  Dave Cole very kindly helped me
to identify the source of the segv.  looks like libct is a bit
more temperamental than the libsybdb that I'm used to:  it gets
upset if the locale in LANG envar isn't in locales.dat, in the 
block for your OS.  segv seems like a rather extreme response
to this condition, but that's Sybase's problem :-)

am starting to get my bearings, have figured out where col names/types 
are stashed (c.description) after execution of a query.

but now am puzzled because I got a rowcount of -1 when I expected to
get a rowcount of <number of rows returned>.  here's the braindead code.

    c.execute('select * from numbers order by tablename')
    print c.description
    a = []
    for item in c.description:
        a.append(item[0])
    print "COL NAMES:",a
    print c.rowcount," ROWS"
    for row in c.fetchall():
        print row

python test.py
[('tablename', 0, 0, 30, 0, 0, 0), ('nserial', 8, 0, 4, 0, 0, 0), ('uid', 7, 0, 2, 0, 0, 32), ('stamp', 13, 0, 4, 0, 0, 32)]
COL NAMES: ['tablename', 'nserial', 'uid', 'stamp']
-1  ROWS
('Agents', 200, 1, '25/07/96')
('Alarms', 1, 1, '28/04/97')
...
currentThread(): no current thread for 1024

why do I get -1 rows?  the dbapi doco says this value is -1 when no
command has been executed;  but as you see, a SQL command has been
executed and rows are being returned.  am I missing something?

also as you see I keep getting this "no current thread" message.
it seems harmless (like a bogus condition on image rundown) but
I wish I knew what it meant.

de

-- 
.............................................................................
:De Clarke, Software Engineer                     UCO/Lick Observatory, UCSC:
:Mail: [email protected] |                                                     :
:Web: www.ucolick.org |             Don't Fear the Penguins                 :
:1024D/B9C9E76E           F892 5F17 8E0A F095 05CD  EE8B D169 EDAA B9C9 E76E:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.