Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. [root@minefield goal]# ./pypy-c
  2. Python 2.7.1 (a97d08283ea7+, May 31 2011, 09:50:10)
  3. [PyPy 1.5.0-alpha0 with GCC 4.5.1] on linux2
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. And now for something completely different: ``rpython: syntax and semantics of
  6. python, speed of c, restrictions of java and compiler error messages as
  7. penetrable as MUMPS''
  8. >>>> import cx_Oracle as dbdriver
  9. >>>> dbuser = '***'
  10. >>>> dbpassword = '***'
  11. >>>> db_host_port = '192.168.211.118:1521'
  12. >>>> db_database = '***db'
  13. >>>> dbconn = dbdriver.connect('%s/%s@%s/%s' % (dbuser, dbpassword, db_host_port, db_database))
  14. >>>> dbconn
  15. <Connection object at 0x0b099488>
  16. >>>> cur = dbconn.cursor()
  17. >>>> cur.execute('select :value from dual', "it works!")
  18. Traceback (most recent call last):
  19.   File "<console>", line 1, in <module>
  20. DatabaseError: ORA-01036: illegal variable name/number
  21.  
  22. >>>> cur.execute('select :value from dual', value="it works!")
  23. <Cursor object at 0x0b042b00>
  24. >>>> cur.fetchone()
  25. ('it works!',)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement