General discussion

  • Creator
    Topic
  • #2091363

    Terminating a loop based on user input

    Locked

    by amal_iv ·

    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.

All Comments

  • Author
    Replies
    • #3869283

      Terminating a loop based on user input

      by andrewf ·

      In reply to Terminating a loop based on user input

      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 ?

    • #3714436

      Terminating a loop based on user input

      by jereg ·

      In reply to Terminating a loop based on user input

      you could try calling a Visual Basic routine to do that.

    • #3715155

      Terminating a loop based on user input

      by amal_iv ·

      In reply to Terminating a loop based on user input

      This question was auto closed due to inactivity

Viewing 2 reply threads