1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| #!/usr/bin/python
# -*- coding: utf-8 -*-
'''connection base oracle ''
import cx_Oracle
connection = cx_Oracle.connect('xxxx')
print connection.version
cursor = connection.cursor()
cursor.execute("""
SELECT MAINTENANCE_MAIN_PK,
MAINTENANCE_CARAC,
STATUS_STATUS_PK,
CLIENT_NAME,
CATEGORY_CATEGORY_PK,
EQUIPMENT_NAME,
TO_CHAR(MAINTENANCE_ATT_DATE,'YYYY-MM-DD'),
MAINTENANCE_TIME FROM VQG_MAINTENANCE
""")
rows = cursor.fetchall()
connection.close()
for item in rows:
print item
print len (rows) |
Partager