Difference between revisions of "Oracle Notes"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) |
PeterHarding (talk | contribs) |
||
Line 5: | Line 5: | ||
<pre> | <pre> | ||
SELECT table_name FROM user_tables; | SELECT table_name FROM user_tables; | ||
select * from all_users; | |||
select * from all_users order by USERNAME; | |||
select * from user_objects where object_type = 'TABLE'; | |||
select * from all_objects where object_type = 'TABLE' and OBJECT_NAME = 'BUG'; | |||
describe USER_TAB_COLUMNS; | |||
</pre> | </pre> | ||
* http://cisnet.baruch.cuny.edu/holowczak/oracle/sqlplus/#SECTION00051000000000000000 | |||
==cx_Oracle== | ==cx_Oracle== |
Revision as of 23:09, 18 October 2010
Notes
Exploring Oracle
SELECT table_name FROM user_tables; select * from all_users; select * from all_users order by USERNAME; select * from user_objects where object_type = 'TABLE'; select * from all_objects where object_type = 'TABLE' and OBJECT_NAME = 'BUG'; describe USER_TAB_COLUMNS;
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
- http://cx-oracle.sourceforge.net/
- http://cx-oracle.sourceforge.net/html/index.html
- http://wiki.oracle.com/page/Python
- http://www.oracle.com/technology/pub/articles/devlin-python-oracle.html
- http://www.oracle.com/technology/pub/articles/tuininga-cx_oracle.html