Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP!accept user input and check input value (PL/SQL)

Re: HELP!accept user input and check input value (PL/SQL)

From: Eric Givler <egivler_at_flash.net>
Date: Sun, 10 Sep 2000 16:17:23 GMT
Message-ID: <nuOu5.1657$oc3.140358@news.flash.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US