How to catch exceptions occured while TOraQuery.Execute?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Guest

How to catch exceptions occured while TOraQuery.Execute?

Post by Guest » Fri 02 Sep 2005 12:30

hi there,

i wrote a daemon using the toraquery class to insert data in a database. if the database goes down or the session dies for some reason i want to catch the EOraError Exceptions.

code is similar to:

try
toraquery.Execute;
Except on EOraError do begin
do some error handling
end;

i can see that an execption occurs in the delphi debugger when i kill the oracle session, but for any reason the exception is not raised and no error handling is done. can you suggest any way to catch the exception?

thx and br, klaus eckhardt.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 05 Sep 2005 12:58

You can use TOraErrorHandler component or TOraSession.OnError event handler for such tasks.

Guest

thank you for your suggestion

Post by Guest » Tue 06 Sep 2005 13:38

thank you for your suggestion. it was not so simple, but at last it works.
br, klaus.

Post Reply