Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

$$$ Please explain for each step in this sample Program? MAIN Step 1 DoWhen %Sel

ID: 3932663 • Letter: #

Question

$$$

Please explain for each step in this sample Program? MAIN Step 1 DoWhen %Select (EMPLID) SELECT EMPLID FROM ABC PeopleCode SOLExec ("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 Step 2 DoWhen %Select(EMPLID) SELECT EMPLID FROM ABC PeopleCode SOLExec ("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

Explanation / Answer

Assume a Table ABC is having EMPLID field and there are 10 Employee IDs starting from AA, BB, CC, to JJ.
• Application Engine first executes the Select Statement in DoWhen Action.
• Condition gets satisfies as there are 10 rows.(At least one row needed)
• In PeopleCode, message will be displayed as
No of Rows in ABC Table: 10
Employee ID in State Record: AA
• In SQL Action, All the 10 rows will be deleted from table.
• As DoWhen is not a looping Action it will not go back to the Select Statement and execute. It comes out from the Step and executes the next Step.
• In Step2, DoWhen will be executed first.
• Condition gets fail as there are no rows. So it will not execute the Subsequent Actions PeopleCode and SQL.