Guest User

karancho

a guest
Sep 29th, 2011
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import cx_Oracle                                  
  2. from pprint import pprint
  3.  
  4. #connection = cx_Oracle.Connection("%s/%s@%s" % (>
  5. connection = cx_Oracle.Connection("HR", "hr")
  6. cursor = cx_Oracle.Cursor(connection)
  7. sql = "SELECT TABLE_NAME FROM ALL_TABLES"
  8. cursor.execute(sql)
  9. data = cursor.fetchall()
  10. print "TABLE_NAME"
  11. pprint(cursor.description)
  12. pprint(data)
  13. cursor.close()
  14. connection.close()
  15.  
Advertisement
Add Comment
Please, Sign In to add comment