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.
If you are look to in write a PL/SQL block then you should change the default delimiter from semi colon to a forward slash. This can be done by placing a forward slash like this – %Execute(/)
The sample code below would make things clear.
%Execute(); SQL Statement One; SQL Statement Two; SQL Statement Last; %Execute(/) SQL Statement One/ SQL Statement Two/ SQL Statement Last/ |
GOOD ONE
Thanks Sid!
helpful
@Satyajith – Glad that you found it helpful.
I tried the code above, but it doesn’t seem to work if the sql statements are exec commands. Is there anyway to use multiple exec commands in a single sql action?