[DB-SIG] DCOracle2 and Exceptions
Richard Brosnahan
broz@mac.com
Wed, 10 Apr 2002 13:05:47 -0400
I've thrown a lot of different query expressions at this, and find most of
them work correctly AND it does NOT throw an exception. This is good.
Once in awhile I throw a perfectly good query at it, it correctly executes
the query and then throws an exception anyway. This is still kind of odd,
but very likely something on my end that needs fixing.
Thanks very much for your help!!
on 4.10.2002 10:07 AM, Matthew T. Kromer at matt@zope.com typed these words:
> Richard Brosnahan wrote:
>
>> Hi folks,
>>
>> This is probably a simple question, and something I might eventually figure
>> out, but I thought I'd post here to expedite things a bit.
>>
>> I've wrapped a self.oraCursor.execute(theQuery) call in a try block, to trap
>> bad queries. I'd like to know when a bad query gets passed in and what's
>> wrong. Heck, just knowing it's a bad query would be a big help. The problem
>> is, EVERY query passed in drops into one of the exceptions (DatabaseError).
>> I print the query and plunk it into sqlplus, where it works fine. Nothing
>> wrong with it. Indeed, DCOracle is processing the query and the database is
>> modified as expected. What am I missing here?
>>
>> DCOracle2 (stable), Red Hat 7.2, Oracle 9i, Python 2.2.
>>
>> Here's a code snippet:
>>
>>
>> try:
>> try:
>> self.oraCursor = self.conn.cursor()
>> self.oraCursor.execute(theQuery)
>>
>> e
>>
>
> And self.conn is a valid connection object? The most likely answer is
> that you aren't connected to the database. The Oracle error message is
> raised as the value of the error -- what does it say?
--
Richard Brosnahan
Editor in Chief
Broz News
Hand Picked Technical News
Updated Every Business Day!
http://broznews.com/