I have a query against an Oracle database using cx_Oracle. The results from the query come as
(datetime.datetime(2010, 11, 25, 14, 30, 47),)
I get this by using the below code:
#!/usr/bin/python
import obi
from datetime import datetime
conn = obi.connect_obi()
query = obi.run_query(conn, "SELECT column FROM table_name")
for i in query:
print i
What I want to do is extract the time, date, etc. from the results.
I've tried using various datetime methods, but I can't figure how to access the individual elements from the returned list. I get various errors about it being a tuple, a list ,etc depending on what attempts I make. I've looked at examples on Google and I can get those to work fine - what do I need to do differently to successfully access the time/date in this datetype?
Thanks! Jack