Question

Q9. Please explain for each step in this sample Program? MAIN Step1 DoWhen %Select(EMPLID) SELECT EMPLID...

Q9. Please explain for each step in this sample Program?

MAIN

Step1

DoWhen

%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

Step2

DoWhen

%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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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.
Add a comment
Know the answer?
Add Answer to:
Q9. Please explain for each step in this sample Program? MAIN Step1 DoWhen %Select(EMPLID) SELECT EMPLID...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT