Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cx_Oracle
- from pprint import pprint
- #connection = cx_Oracle.Connection("%s/%s@%s" % (>
- connection = cx_Oracle.Connection("HR", "hr")
- cursor = cx_Oracle.Cursor(connection)
- sql = "SELECT TABLE_NAME FROM ALL_TABLES"
- cursor.execute(sql)
- data = cursor.fetchall()
- print "TABLE_NAME"
- pprint(cursor.description)
- pprint(data)
- cursor.close()
- connection.close()
Advertisement
Add Comment
Please, Sign In to add comment