418 |
self._recordSetClass = DBSIG_RecordSet |
self._recordSetClass = DBSIG_RecordSet |
419 |
self._fieldNames = [] |
self._fieldNames = [] |
420 |
|
|
421 |
if self._cursor: |
if self._cursor and self._cursor.description: |
422 |
if fieldNames: |
if fieldNames: |
423 |
self._fieldNames = fieldNames |
self._fieldNames = fieldNames |
424 |
else: |
else: |
431 |
GDebug.printMesg(5, 'ResultSet created') |
GDebug.printMesg(5, 'ResultSet created') |
432 |
|
|
433 |
def _loadNextRecord(self): |
def _loadNextRecord(self): |
434 |
if self._cursor: |
if self._cursor and self._cursor.description: |
435 |
rs = None |
rs = None |
436 |
|
|
437 |
try: |
try: |
550 |
def _checkForPrimaryId(self): |
def _checkForPrimaryId(self): |
551 |
self._primaryIdChecked = 1 |
self._primaryIdChecked = 1 |
552 |
|
|
553 |
|
# Ejecuta un select crudo y devuelve un RecordSet. |
554 |
|
def _createRawResultSet(self, statement): |
555 |
|
rs = None |
556 |
|
try: |
557 |
|
cursor = self._dataConnection.cursor() |
558 |
|
cursor.execute(statement) |
559 |
|
rs = self._resultSetClass(self, cursor=cursor, masterRecordSet=None) |
560 |
|
except self._DatabaseError, err: |
561 |
|
raise GDataObjects.ConnectionError(str(err)) |
562 |
|
|
563 |
def _createResultSet(self, conditions={}, readOnly=0, masterRecordSet=None): |
return rs |
564 |
|
|
565 |
|
def _createResultSet(self, conditions={}, readOnly=0, masterRecordSet=None): |
566 |
if self._outerJoinCondition and not self._outerJoin: |
if self._outerJoinCondition and not self._outerJoin: |
567 |
self._outerJoin = self._outerJoinConditionToSQL(self._outerJoinCondition) |
self._outerJoin = self._outerJoinConditionToSQL(self._outerJoinCondition) |
568 |
import re |
import re |
569 |
auxStr = self._outerJoin[:] |
auxStr = self._outerJoin[:] |
570 |
self.table = ", ".join(self.reJoinToTable.findall(auxStr)) # Extrae las tablas a partir del self._outerJoin mediante |
self.table = ", ".join(self.reJoinToTable.findall(auxStr)) # Extrae las tablas a partir del self._outerJoin mediante |
571 |
# una expresión regular (gentileza de John) |
# una expresión regular (gentileza de John) |
572 |
|
if not hasattr(self,'table'): |
573 |
|
return self._resultSetClass(self, cursor=self._dataConnection.cursor(), masterRecordSet=masterRecordSet) |
574 |
|
|
575 |
|
|
576 |
# Used by drivers with a unique id (like rowid) |
# Used by drivers with a unique id (like rowid) |
577 |
if not self._primaryIdChecked: self._checkForPrimaryId() |
if not self._primaryIdChecked: self._checkForPrimaryId() |