[Zope-DB] Getting a cursor?
charlie at egenix.com
Thu Sep 28 05:20:13 EDT 2006
Am 28.09.2006, 00:26 Uhr, schrieb Paul Winkler <pw_lists at slinkp.com>:
> I'll be writing product code, and am currently just experimenting via
> zopectl debug, so I have full access to everything. But I still can't
> see how to get a cursor or anything else that will let me retrieve
> multiple record sets from one STP call.
> What should I be looking for?
> ./bin/zopectl debug
> Starting debugger (the name "app" is bound to the top-level Zope object)
>>>> conn = app.sweetums_test()
> <Products.mxODBCZopeDA.ZopeDA.DatabaseConnection "DSN=MSSQLdsn" thread
> 47227742061040/47227742061040 at 0x2aaaab0907e8>
You don't need an explicit cursor as you already have one for your
connection. Simply use callproc()
rset = conn.fetchone()
if conn.nextset() is None: break
More information about the Zope-DB