DCOracle2 - Can't get cursor.execute to return data when SQL query involves datetimes.
Jim
jtt at hnc.com
Tue Jun 4 15:39:18 EDT 2002
Hello,
I am trying to write a simple program to retrieve 2 colums from a
table.
I am running on Solaris 2.8, Python 2.1.1, DCOracle2 and Oracle
8.1.7.3.
The columns are:
acct_number ( one char long)
transaction_datestamp (oracle datetimestamp)
Here is my program:
import DCOracle2
trandt = '19970110121212'
db = DCOracle2.connect("uid/pwd")
c = db.cursor()
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 = c.execute,('select acct_nbr, trn_dt from testtable where
ACCT_NBR = :1 and TRN_DT = :2',"1",dt)
aaa = c.fetchone()
print aaa
The execute never return any thing from query when the date timestamp
is part of the query. If I only query on the acct_nbr it returns the
expected row.
What am I missing ???
Thanks,
jim.
More information about the Python-list
mailing list