Explain for each step in this sample Program MAIN Step1 DoW
$$$
Explain for each step in this sample Program? MAIN Step1 DoWhile %Select(EMPLID) SELECT EMPLID FROM ABC PeopleCode SQLExec(\"SELECT COUNT(*) FROM ABC\", &Count;); MessageBox(0, \"\", 0, 0, \"No of Rows in ABC Table: \" | &Count;); MessageBox(0, \"\", 0, 0, \"Employee ID in State Record:\" | CNU_AET.EMPLID, Value); SQL DELETE FROM ABC WHERE EMPLID IN (SELECT TOP 5 EMPLID FROM ABC ORDER BY EMPLID DESC)Solution
• Application Engine first executes the Select Statement in DoWhile Action.
 • Condition gets satisfies as there are 10 rows.(At least one row needed)
 • Inserts first employee AA into State Record and continues the execution with rest of the Actions.
 • In PeopleCode, message will be displayed as
 No of Rows in ABC Table: 10
 Employee ID in State Record: AA
 • In SQL Action, Top 5 rows in descending order (JJ, II, HH, GG, and FF) will be deleted.
 • Application Engine again executes the Select Statement.
 • Condition gets satisfies as there are 5 rows.(At least one row needed)
 • Inserts first employee AA into State Record and continues the execution with rest of the Actions.
 • In PeopleCode, message will be displayed as
 No of Rows in ABC Table: 5
 Employee ID in State Record: AA
 • In SQL Action, Top 5 rows in descending order (EE, DD, CC, BB, and AA) will be deleted.
 • Application Engine again executes the Select Statement.
 • Condition gets fail as there are no rows.(At least one row needed)
 • Comes out from the Step and as there are no other section to execute, program will end.

