Discussion Locked

Terminating a loop based on user input

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do I terminate a loop in a PL/SQL block depending upon user input.

For Example:
Suppose the purpose of the PL/SQL vlock is to display total of all the numbers entered by the user. The user enters one number after which a confirmation is asked whether he wants to enter more numbers. If the responds with a Y then the next number is asked. This continues till the user responds with N. Then the total of all the numbers are returned.

5 replies

by andrewf

Hi,

I was under the impression that PL/SQL was not interactive, and that once a block was called it could not really interact with the user. In a case such as that I would have a PL/SQL sub/function called by an external source that stored the value in a small table.. The calling app could then take responsibility for checking the Y/N input.

Any other suggestions ?

This discussion is closed to new replies.