Print Thread
Not seeing oracle exceptions using TOracleQuery
#4038 10/18/02 07:26 PM
Joined: Oct 2002
Posts: 4
R
Member
OP Offline
Member
R
Joined: Oct 2002
Posts: 4
For some reason the only time I see oracle exceptions is when I have the delphi break on exception checkbox checked.

I'm using TOracleQuery.

I've tried catching the exceptions in a try..except block using:
e:Exceptions
e:EDatabaseError
e:EOracleError
But no oracle exceptions are raised (when break turned off).

Is there a compiler option I'm missing? Or something else I'm missing?

I'd really like to handle the exceptions.

Re: Not seeing oracle exceptions using TOracleQuery
#4039 10/21/02 10:11 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
There are no specific requirements:
[quote]
Code
try
  Query.Execute;
except
  on E:EOracleError do ShowMessage(E.Message);
end;
[/quote]
Can you post your code?


------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Not seeing oracle exceptions using TOracleQuery
#4040 10/25/02 07:06 PM
Joined: Oct 2002
Posts: 4
R
Member
OP Offline
Member
R
Joined: Oct 2002
Posts: 4
The code in the previous message is the code I've tried:

try
...
Query.Execute;
except
on E:EOracleError do
ShowMessage(E.Message);
end;

As I said if I have the break on exception option selected in the Delphi 6 IDE then I'll see the oracle exception, but otherwise I don't.

Is there a property that needs to be set to force oracle exceptions to be raised?

Re: Not seeing oracle exceptions using TOracleQuery
#4041 10/28/02 11:19 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
There is no property that needs to be set. If it breaks in the IDE, then you should be able to trace execution. Does it go through the exception handler? Is it an EOracleError that occurs? What happens if you change E:EOracleError to E:Exception? This must pass through the exception handler.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Not seeing oracle exceptions using TOracleQuery
#4042 10/29/02 06:58 AM
Joined: Oct 2002
Posts: 4
R
Member
OP Offline
Member
R
Joined: Oct 2002
Posts: 4
I've tried E:Exception and E:EDatabaseError and niether catches the exception. When I tried E:exception and it didn't catch the error I explicitly raised an exception Raise Exception.Create(...) just before the execute and that exception took me into the exception block, but oracle exceptions just are doing it.

I have since tried the code in Delphi 5 on a different machine and still no oracle exceptions.

I'm NOT using an Application.OnException so I'm not overriding any exception handlers.

Re: Not seeing oracle exceptions using TOracleQuery
#4043 10/29/02 10:46 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
I'm clueless. Can you create a little demo project that does not handle the exception, and send it to me?

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Not seeing oracle exceptions using TOracleQuery
#4044 11/18/02 10:31 AM
Joined: Oct 2002
Posts: 4
R
Member
OP Offline
Member
R
Joined: Oct 2002
Posts: 4
It'd be nice if I could, but I can't.

On a generic level, the code is simple.

Form creates a datamodule. This datamodule has has two TOracleSessions on it. This data module in turn creates some other datamodules (all inherited from the same baseclass) with some TOracleQuerys on them.

I drop some temptables (if any), create some new temp tables and create some dynamic sql and execute it. I just need to be able to catch the exceptions (like if a temp table isn't there when I drop it... I'd like to know that).

Other than the sessions for the queries and the SQL itself, I don't change any of the properties at run time. It's just real basic code.

Has anyone else seen this problem?

Re: Not seeing oracle exceptions using TOracleQuery
#4045 12/16/05 09:18 AM
Joined: Dec 2005
Posts: 1
China
M
Member
Offline
Member
M
Joined: Dec 2005
Posts: 1
China
try to use OnArrayErr event to catch the TOracleQuerys executing errors!


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.081s Queries: 13 (0.031s) Memory: 2.5319 MB (Peak: 3.0427 MB) Data Comp: Off Server Time: 2024-05-21 20:40:23 UTC
Valid HTML 5 and Valid CSS