トランザクションを開始内で発生したエラーの取得について

Database.Activityのトランザクションを開始を利用し、OracleやSQL ServerのDBに接続し、データの検索、更新、挿入を行っています。
トランザクションを開始内には、SQL文の作成に代入やSQLの発行にクエリを実行、コマンドを実行のアクティビティを利用しています。
この処理をStudioから実行してみると、SQL文の作成時やDB側でエラー、例えばOra-XXXXといったOracleのエラーが発生してもエラーとして出力されません。
デバッグで実行した際には、エラーが出力されます。
トランザクションを開始をトライキャッチの中に入れ、エラー発生時に処理を継続をTrue,Falseの両方で試しても同様でした。
実際の運用時には、事前にエラーにならないようにSQL文やデータの確認を行いますが、想定してなかったエラーが発生した場合、エラーを取得できないのではと思い、どのようにすればエラーが出力されるのでしょうか?

@ChikaA

Welcome to the community

If there is an error in the statement or the statement could not be executed…then you would get an error from the execute query activity…which can be caught using Try catch…please check if you checked the continueonerror property if so uncheck it

Apart from that execute query will give you an output as well about which rows are modified or effected because of the query

Cheers

トランザクションを開始をトライキャッチの中に入れました
クエリを実行の前後にメッセージをログを入れ、わざとエラーになるSQLをクエリを実行に設定。
この状態で実行しましたが、DB実行前のメッセージで止まり、何もエラーが出力されません。

トライキャッチの設定が正しくないのでしょうか?

@ChikaA

Can you show your catch block and use step into to check each step and where it is failing

Cheers

デバッグで実行したときは、エラーが出力されます。
キャッチは、System.Exceptionを設定しています。

@ChikaA

This exception will be caught with the current setup…

when you do A Stepinto after the error it will move to catch block log message

cheers

エラーが発生後、ステップインで処理を進めましたが
キャッチに進まず、トライキャッチから抜けます。

@ChikaA

Can you uncheck this property if checked

image

cheers

チェックは入っていません。
6

@ChikaA

If you check that any exception will be ignored…that is the reason it is not being caught. We need to uncheck it

cheers

Database.Activities.DatabaseTransaction’s [Continue on error] is false, but the error is not caught.
Where do I need to unlock it?

@ChikaA

Is it false for the activity which is throwing it also?

If not caught…can you please remove the try catch and add it again and check…ideally if this property is false then the exceptions would be caught

Cheers

Thanks for your help.
I removed try-catch and added it again. And all properties [continue on error] are now false.
But the error is not caught.
I will ask UiPath support.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.