Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP!accept user input and check input value (PL/SQL)
Some thoughts...
This is something that is NOT something that can be done inside of PL/SQL. If you are going to have more "complex processing" (conditional logic based on user input), you should write a program (a form) or a 3gl around your pl/sql block.
Otherwise, in a SQL*Plus script, you could use the ACCEPT statement, and get
the users response.
Include a statement: Whenever sqlerror exit failure
After the accept statement, you could check for the "Y" response:
dummy varchar2(1)
Begin
select 'x' into :dummy from dual where user_response = 'Y';
End;
/
If the user entered something other than a Y, then your script would immediately exit due to a SQLNotfound. (ora-1403) Good luck.
"Ho" <kowho_at_singnet.com.sg> wrote in message
news:8pfkrp$tr2$2_at_violet.singnet.com.sg...
> 1.I need to prompt a message 'Do you want to proceed ? (Y/N)'.
> 2.I expect the user to key in Y or N
> 3.The program will check user's reply. If reply=Y do process else no
> nothing.
> What command can I use to accept input from user in PL/SQL ?
> How can I store the user input to a variable so that the reply can be
> determined ?
> Many thanks for your help in advance.
>
>
>
>
Received on Sun Sep 10 2000 - 11:17:23 CDT
![]() |
![]() |