PL/SQL prompting? [message #38941] |
Wed, 29 May 2002 13:29 |
Stephen
Messages: 26 Registered: January 2000
|
Junior Member |
|
|
Hello,
Does anyone know if there is a way to halt a PL/SQL program to accept a variable from a user? Basically I am looking for a way to do the following in PL/SQL instead of standard SQL shown here:
ACCEPT p_selection PROMPT 'Enter Your Selection: '
If anyone has any ideas or suggestions, it would be greatly appreciated.
|
|
|
Re: PL/SQL prompting? [message #38942 is a reply to message #38941] |
Wed, 29 May 2002 13:48 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
No it's not possible to do in pl/sql. The accept command is only a sqlplus command. You can use that parameter in anomous pl/sql though.
e.g ACCEPT p_selection char PROMPT 'Enter Your Selection: '
set serveroutput on
begin
dbms_output.put_line('p_selection='||'&p_selection');
my_proc('&p_selection');
end;
/
Use the quotes to avoid the code breaking if p_selection is ever NULL
|
|
|