Re: [cx-oracle-users] Extracting Oracle error codes, characterizing exceptions
Brought to you by:
atuining
|
From: ????? ???? <op...@sa...> - 2004-02-17 11:37:38
|
Hi,
Try like in this
short example:
------------------------------------------------<cut>-----------------------
--------------------
try:
my_connection=cx_Oracle.connect('system/manager@test_db')
except cx_Oracle.DatabaseError,info:
print "Logon Error:",info
exit(0)
my_cursor=my_connection.cursor()
try:
my_cursor.execute("""
SELECT ROWID,O.* FROM TESTER.PODR O """)
except cx_Oracle.DatabaseError,info:
print "SQL Error:",info
exit(0)
------------------------------<end cut
>-------------------------------------
Best regards,
Oleg Popov
op...@ya...
----- Original Message -----
From: "Jeff Wong" <jef...@sa...>
To: <cx-...@li...>
Sent: Monday, February 16, 2004 11:41 PM
Subject: [cx-oracle-users] Extracting Oracle error codes, characterizing
exceptions
> Is there way to extract Oracle error codes other than by applying str() to
> the exception and parsing the string?
>
> Also, if I cannot connect to the Oracle database would that be a
> DatabaseError or an InternalError?
>
> I am trying to use cx_Oracle to write a server that needs to be reliable
> and I am trying to figure out how to handle possible exceptions returned
> from Oracle.
>
> I also noticed that violations of table constraints are DatabaseErrors,
> rather than DataErrors. Is this intended? What are examples of
> DataErrors?
>
> Thanks,
>
> Jeff
>
>
>
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> cx-oracle-users mailing list
> cx-...@li...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
|