$$$ Explain for each step in this sample Program? MAIN Step 1 DoWhen %Select (EM
ID: 3932667 • Letter: #
Question
$$$
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 ABCExplanation / 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.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.