Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am trying to select * from a database table and format the
"SQL Time Stamp" in the list I am building using a for loop.
When I run the code below, I get
for the START_TIME and END_TIME.
- Is there way to format the date? If so, how?
- Is there a way to select individual fields from the
result set, not just fetchall() or fetchmany(x)?
import dbi, odbc
jobsD = 
conn = odbc.odbc('myOracle/user/pass')
c = conn.cursor()
sql = "select field1,START_TIME,END_TIME,field4 from table_name"
x in c.fetchall():
for x in c.fetchmany(5):
print 'error ', e