[cx-oracle-users] cx_Oracle4.3.1: - describe table query is not working!!!
Brought to you by:
atuining
From: Piyush C. <piy...@tc...> - 2007-05-09 08:57:05
|
Hi all... Just have a look on the code below... (We have 'sample database with one of the table 'tab1' & user 'demo') #We are trying to fetch all the columns from the table specified & their type. #This is done by using 'describe <table-name>' sql query in Oracle. import cx_Oracle connection = cx_Oracle.Connection("demo/demo@sample") cursor = connection.cursor() cursor.execute("describe tab1") for row in cursor.description: print "Column Name is: ",row[0] print "Column Type is: ", row[1] print "------------------------------------------------" #But this is giving error that is: - cx_Oracle.DatabaseError: ORA-00900: invalid SQL statement #I got some other method to implement this, but that is a bit lengthy. (can put that also if required) #My quetion is that does cx_Oracle supports 'describe <table-name>' query or not??? Regards, cPiyush. =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you |