DCOracle2 - Can't get cursor.execute to return data when SQL query involves datetimes.

Jim jtt at hnc.com
Wed Jun 5 09:57:36 EDT 2002


Here is better version of the same program.  Sorry for last posting. 

! /usr/bin/env python
import DCOracle2
#*************************************************************
# Define variables and constants
#*************************************************************
TRUE = 1
FALSE = 0
FalconPwd = 'uid/pwd'
Results_count = 0
db = DCOracle2.connect(FalconPwd)
#
# Open a new cursor
#
dbCursor = db.cursor()
tran_date = '19970116124248'
dt = DCOracle2.Timestamp(int(tran_date[0:4]), int(tran_date[4:6]),
int(tran_date[6:8]), int(tran_date[8:10]), int(tran_date[10:12]),
int(tran_date[12:14]))

Results_count = DCOracle2.execute(dbCursor,'select * from
falcon.falt002d where ACCT_NBR = :1 and trn_dt = :2',"2222222222222222
  ",dt)


tabledata = dbCursor.fetchone()

print tabledata



More information about the Python-list mailing list