375 |
def getTimeStamp(self): |
def getTimeStamp(self): |
376 |
return self.__singleQuery("select current_timestamp") |
return self.__singleQuery("select current_timestamp") |
377 |
|
|
378 |
|
def getUnixTimeStamp(self): |
379 |
|
return self.__singleQuery("select extract(epoch from current_timestamp)") |
380 |
|
|
381 |
# Return a sequence number from sequence 'name' |
# Return a sequence number from sequence 'name' |
382 |
def getSequence(self, name): |
def getSequence(self, name): |
383 |
return self.__singleQuery("select nextval('%s')" % name) |
return self.__singleQuery("select nextval('%s')" % name) |
516 |
where.append ("%s=%s" % (auxField, dataObject._toSqlString(record._initialData[iterField]))) |
where.append ("%s=%s" % (auxField, dataObject._toSqlString(record._initialData[iterField]))) |
517 |
if cond: |
if cond: |
518 |
where.append(cond) |
where.append(cond) |
519 |
|
|
520 |
|
if record._haveHistory(table): |
521 |
|
where.append("_end_t IS NULL") |
522 |
|
|
523 |
cursor = self.__connection.cursor() |
cursor = self.__connection.cursor() |
524 |
|
|
543 |
try: |
try: |
544 |
if autoCommit: |
if autoCommit: |
545 |
self.__connection.rollback() |
self.__connection.rollback() |
546 |
#cursor.close() |
print >> sys.stderr, "DBdriver.py", "error! %s" % sys.exc_info()[1] |
547 |
|
GDebug.printMesg(1,"**** Unable to execute extension query") |
548 |
|
GDebug.printMesg(1,"**** %s" % sys.exc_info()[1]) |
549 |
|
raise GDataObjects.ConnectionError("el registro a actaluzar no existe") |
550 |
except: |
except: |
551 |
print >> sys.stderr, "DBdriver.py", "error! %s" % sys.exc_info()[1] |
print >> sys.stderr, "DBdriver.py", "error! %s" % sys.exc_info()[1] |
552 |
GDebug.printMesg(1,"**** Unable to execute extension query") |
GDebug.printMesg(1,"**** Unable to execute extension query") |
553 |
GDebug.printMesg(1,"**** %s" % sys.exc_info()[1]) |
GDebug.printMesg(1,"**** %s" % sys.exc_info()[1]) |
|
cursor.close() |
|
554 |
raise GDataObjects.ConnectionError(str(sys.exc_info()[1])) |
raise GDataObjects.ConnectionError(str(sys.exc_info()[1])) |
555 |
|
|
556 |
if field.count('.') > 0: |
if field.count('.') > 0: |