PeopleTools and Lifecycle Management - PSFT (MOSC)

MOSC Banner

Using try-catch for SQLExec in App Engine peoplecode

edited Dec 3, 2016 11:01AM in PeopleTools and Lifecycle Management - PSFT (MOSC) 8 commentsAnswered

Hello - I am trying to handle the fatal SQL Error caused by SQLExec, by wrapping it in try-catch.

In my test case below, I am inserting a value that already exists in my table, and hence a unique constraint should occur as error.

Here is my sample code block (and the test app engine for this, as just one section-one step and one action (PC)).

try

   SQLExec("INSERT INTO PS_XX_TEST VALUES ('Test')");

catch Exception &ex

  

   /* Display messages in process Monitor Log */

   MessageBox(0, "", 21000, 100, "", &ex.ToString());

   MessageBox(0, "", 21000, 100, "", "Exceptions found ! Check details in log file ");

   Exit (0);

end-try;

Since I am exiting as 0, so, there is a zero return, hence the AE should not abend. Still it abends.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center