[DB-SIG] Please some clarification of DB Spec 2.0
M.-A. Lemburg
mal@lemburg.com
Sat, 13 Nov 1999 09:38:18 +0100
Jose de Leon wrote:
>
> Hello!
>
> I apologize if I ask questions asked many times before. I'd search the
> archives but my connetion to the python site is VERY slow.
>
> First:
> a) I'm new to python.
> b) I'm new to the Python DB Spec 2.0.
>
> I'm creating a database module interface. But before I code it python. I'm
> trying to code it in C++, a language I know much better. I then intend to
> use SWIG to convert the C++ code to python. Possibly by creating a python
> shadow wrapper.
>
> One of the items I need clarification on is "sequence".
>
> What exactly is a sequence and how can I relate that to a C++ datatype?
> >From what I can gather from "Programming Python" by O'Reilly is that it is a
> string with delimiters. Or it could be an array?
Its a conglomeration of elements which can be indexed using integers.
Python lists and tuples are examples for sequences. C arrays also
fit this definition. Basically, they have to provide a length and
a method which allows indexing all elements starting from index 0
to length - 1.
> The specific specification from the DB Spec 2.0 that confuses me is the
> description for a the "description" method of a Cursor object.
>
> It explains:
>
> description
> This read-only attribute is a sequence of 7-item sequences....etc.
This normal refers to a tuple of tuples, one 7-tuple (a tuple
of length 7) for each column in the result set.
> Likewise, the description for "fetchone()" method also confuses me on how to
> return the data. Should the data be returned in an array?
It should return a sequence, such as a tuple corresponding to
a row in the result set, with each element representing a column
entry.
Hope that helps,
--
Marc-Andre Lemburg
______________________________________________________________________
Y2000: 48 days left
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/