[IronPython] MySQL and Iron Python

Vernon Cole vernondcole at gmail.com
Sun Jul 25 03:29:12 CEST 2010


Alpha test of field (column) name reading in adodbapi  v 2.4.A1. (see below)

On Tue, Jul 20, 2010 at 2:47 PM, Vernon Cole <vernondcole at gmail.com> wrote:

> Field name access is the next development step. The API calls for position
> (field number) access. Field name access is an extension. I personally think
> that it is the obvious thing to do, but the movers and shakers of the
> database API don't see it the same way.  My big goal is to add that feature.
> I implemented name access for (input) parameters in the last revision.
> (paramstyle='named').  So for today, you must use column position to read
> the data.
> --
> Vernon
>
>
> On Tue, Jul 20, 2010 at 1:12 PM, Ian Hobson <ian at ianhobson.co.uk> wrote:
>
>>  Thanks Vernon,
>>
>> With your help I now have some data!
>>
>> Now to find out if I can access it by field name and not just position.
>>
>> Thanks again
>>
>> Ian
>>
>> Ian:
  Okay, you pushed me to greater heights...
Try dropping this into your site-packages\adodbapi directory.

If I did it right, the following should work.
<code>
c = someconnection.cursor
c.execute("select foo,bar from someTable")
rows = c.fetchall()
for row in rows:
  print row['foo'], row.bar
</code>

Either the 'rowName.columnName' syntax or the 'rowName['columnName'] syntax
should work.

Is that about what you were looking for?

I want to do some packaging work, but this should be the code for the next
version.
(Congratulations, you are now a beta tester.)

The attachment will replace the adodbapi.py file in the 2.3.0 release .zip.
(The entire beta test is in the mercurial tree at
http://sourceforge.net/projects/adodbapi )
--
Vernon Cole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100724/305f1537/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adodbapi.py
Type: application/octet-stream
Size: 60481 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100724/305f1537/attachment.obj>


More information about the Ironpython-users mailing list