Explain for each step in this sample Program MAIN Step 1 Do

Explain for each step in this sample Program? MAIN Step 1 Do When %Select(EMPLID) SELECT EMPLID FROM ABC PeopleCode SOLExec(\"SELECT COUNT(*) FROM ABC\", &Count;); Message Box(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 Do When %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

Solution

Q9: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.

Assume a Table ABC is having EMPLID field and there are 10 Employee IDs starting from AA, BB, CC, to JJ.

 Explain for each step in this sample Program? MAIN Step 1 Do When %Select(EMPLID) SELECT EMPLID FROM ABC PeopleCode SOLExec(\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site