Question

Question 5 (Marks: 15) Q.5.1 The IF Statement is the most commonly used control-flow statement. Discuss any (10) two of the t
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q. 5.1

There are three forms of IF statements: IF-THEN, IF-THEN-ELSE, and IF-THEN-ELSIF.

The IF statement associates a Boolean value with a sequence of statements enclosed by the keywords THEN and END IF. The sequence of statements is executed only if the boolean value returns TRUE. If the value returns FALSE or NULL, the IF statement does nothing.

The second form of IF statement adds the keyword ELSE followed by an alternative sequence of statements. The sequence of statements in the ELSE clause is executed only if the Boolean value in IF returns FALSE or NULL. By using ELSE it is ensured that a series of statements is executed in either case.

Q.5.2

DECLARE
   invoice_amount NUMBER;
BEGIN
invoice_amount := &enter_value;
IF invoice_amount < 0 THEN
      RAISE_APPLICATION_ERROR(-20021,
        'execute_sql: Negative value entered.  
         Status = ' || status);
    END IF;
END;

Hope this helped. Please do upvote and if there are any queries please ask in comments section.

Add a comment
Know the answer?
Add Answer to:
Question 5 (Marks: 15) Q.5.1 The IF Statement is the most commonly used control-flow statement. Discuss...
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
  • business and society QUESTION 5 (20 Marks) 5.1 Critically discuss the principles of ethical decision making (10 mark...

    business and society QUESTION 5 (20 Marks) 5.1 Critically discuss the principles of ethical decision making (10 marks) 5.2 Propose some practical suggestions for making ethical decisions. (5 marks) 5.3 Indicate why ethical decision making can be difficult (5 marks) QUESTION 6 (20 Marks) There are SEVEN (7) key environments that affect businesses today. Discuss these in the light of forces pushing towards more freedom (free markets) and those pushing towards more state control QUESTION 5 (20 Marks) 5.1 Critically...

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