Numeric fields in .35

"May, Chuck (IMS)" <[email protected]>
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
I am getting an error when I try to select a numeric(6,2) field from a
table.  Here is the code:

    # connect to the database
    db = Sybase.connect('peach5026d', 'may', 'maymay', 'nci_dev')
    c = db.cursor()
    c.arraysize = 64
    c.execute("SELECT volume FROM vial WHERE study_id = 'AHS'")

    while 1:
        rows = c.fetchmany()
        if not rows : break

        for row in rows:
            print row

    c.close()

and here is the error:

(
Traceback (most recent call last):
  File "./test_sybase.py", line 17, in ?
    print row
ValueError: no globla context defined

Searching on the other fields work fine.  Also, changing the SQL to read

   SELECT convert(float, volume) FROM vial WHERE study_id = 'AHS'"

also fixes the error.

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