Saturday 13 December 2014

Multiple SQL Statements in SQL Action in PeopleSoft Application Engine

While writing App Engines, we normally write one SQL statement per SQL Action. That is how it is in most of the delivered App Engine. But in certain situations, we may need to put in multiple SQL statements into a single SQL Action.
This can be achieved by using %Execute function.
In your SQL Action, place the %Execute() on the very first line. Below that you start writing your SQL statements one by one. Take care to delimit each SQL statement with a semi colon as the App Engine expects a semi colon between statements within an %Execute function by default.
The sample code below would make things clear.
%Execute(); 
 SQL Statement One;
 SQL Statement Two;
 SQL Statement Last;