Package CUBRIDdb :: Module cursors :: Class BaseCursor
[hide private]
[frames] | no frames]

Class BaseCursor

object --+
         |
        BaseCursor
Known Subclasses:

A base for Cursor classes. Useful attributes:

description:

   A tuple of DB API 7-tuples describing the columns in 
   the last executed query; see PEP-249 for details.

arraysize:

   default number of rows fetchmany() will fetch
Instance Methods [hide private]
 
__init__(self, conn)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__del__(self)
 
__check_state(self)
 
close(self)
Close the cursor.
 
_bind_params(self, args, set_type=None)
 
execute(self, query, args=None, set_type=None)
Execute a query.
 
executemany(self, query, args)
Execute a multi-row query.
 
_fetch_row(self)
 
fetchone(self)
Fetch the next row of a query result set, returning a single sequence, or None when no more data is available.
 
_fetch_many(self, size)
 
fetchmany(self, size=None)
Fetch the next set of rows of a query result, returning a sequence of sequences (e.g.
 
fetchall(self)
Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g.
 
setinputsizes(self, *args)
Does nothing, required by DB API.
 
setoutputsizes(self, *args)
Does nothing, required by DB API.
 
nextset(self)
Advance to the next result set.
 
callproc(self, procname, args=())
Execute stored procedure procname with args
 
__iter__(self)
Iteration over the result set which calls self.fetchone() and returns the next row.
 
next(self)
Return the next row from the currently executing SQL statement using the same semantics as fetchone().
 
__next__(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conn)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

close(self)

 

Close the cursor. No further queries will be possible.

execute(self, query, args=None, set_type=None)

 

Execute a query.

query -- string, query to execute on server args -- optional sequence or mapping, parameters to use with query.

Returns long integer rows affected, if any

executemany(self, query, args)

 

Execute a multi-row query.

query -- string, query to execute on server

args -- Sequence of sequences or mappings, parameters to use with query

Returns long integer rows affected, if any.

This method improves performance on multiple-row INSERT and REPLACE. Otherwise it is equivalent to looping over args with execute().

fetchmany(self, size=None)

 

Fetch the next set of rows of a query result, returning a sequence of sequences (e.g. a list of tuples). An empty sequence is returned when no more rows are available. The number of rows to fetch per call is specified by the parameter. If it is not given, the cursor's arraysize determines the number of rows to be fetched. The method should try to fetch as many rows as indicated by the size parameter. If this is not possible due to the specified number of rows not being available, fewer rows may be returned.

fetchall(self)

 

Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g. a list of tuples). Note that the cursor's arraysize attribute can affect the performance of this operation.

nextset(self)

 

Advance to the next result set. Returns None if there are no more result sets.

callproc(self, procname, args=())

 

Execute stored procedure procname with args

procname -- string, name of procedure to execute on server

args -- Sequence of parameters to use with procedure

Returns the original args.

next(self)

 

Return the next row from the currently executing SQL statement using the same semantics as fetchone(). A StopIteration exception is raised when the result set is exhausted for Python versions 2.2 and later.