Difference between revisions of "Oracle Notes"

From PeformIQ Upgrade
Jump to navigation Jump to search
Line 1: Line 1:
=Notes=
=Notes=
=Exploring Oracle=
<pre>
SELECT table_name FROM user_tables;
</pre>


==cx_Oracle==
==cx_Oracle==

Revision as of 23:00, 18 October 2010

Notes

Exploring Oracle

SELECT table_name FROM user_tables;

cx_Oracle

>>> import cx_Oracle
>>> conn = cx_Oracle.connect('xxxx','xxxx','XX')
>>> curs = conn.cursor()
>>> curs.arraysize=50

>>> sql = 'SELECT * from DBUSER.BUG'

>>> curs.execute(sql)
<__builtin__.OracleCursor on <cx_Oracle.Connection to xxx@XX>>

>>> print curs.description
...

>>> print curs.fetchone()
...

>>> for x in curs:
	print x
...

>>> curs.execute('describe XXX.BUG')

cx_Oracle Working Notes

Python DBI