Home » SQL & PL/SQL » SQL & PL/SQL » pl/sql program constructs
pl/sql program constructs [message #39696] Fri, 02 August 2002 07:55 Go to next message
jimlo
Messages: 1
Registered: August 2002
Junior Member
You are to discuss in detail these six different program constructs. You should at least cover the following but should not be limited only to these points:

• Explain what are these six different program constructs.
• Compare and contrast each of them.
• Explain when are they being used.
• Discuss the application areas of each and illustrate with samples of codes.
Re: pl/sql program constructs [message #39706 is a reply to message #39696] Fri, 02 August 2002 11:19 Go to previous message
Jon
Messages: 483
Registered: May 2001
Senior Member
Iteration
Branching
Decisions
Comparisons
Sequence
Henway

They are alike in that they are all program constructs, i.e. used by programmers to, um, program stuff, especially software. They are different in that they don't do the same things; otherwise, they would just be one construct and not six.

They are being used when they are in programs, specifically programs that are running, sometimes called run-time programs. Otherwise, they are not being used and then they are pretty much useless.

Loops are useful for repeating logic. For example,

for i in 1..1000 loop
writeOnChalkboard('I will do my own homework and not try to get people on the internet to do it for me');
end loop;

Branching takes the logic of the program to a different place;

goto HelenaHandBasket;

Decision constructs refer to IF-THEN-ELSE

IF IDontKnow THEN
goto Internet;
ELSE
goto AnswerTheQuestionMyself;
END IF;

Comparisons evaluate expressions to return a TRUE or FALSE result:

IF UR > SmarterThanABrick THEN
AlbeeAMonkeysUncle;

Sequence is the order of execution of the statments

DoM;
DoI;
DoC;
DoK;
DoE;
DoY;

& finally...Henway.

What's a Henway?
.
.
.
.
.
.
.
.
.
.
.
.
.
.
about two pounds.
Previous Topic: not exists
Next Topic: OUT Parameters
Goto Forum:
  


Current Time: Fri Apr 26 21:25:32 CDT 2024