Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL prompting?
PL/SQL prompting? [message #38941] Wed, 29 May 2002 13:29 Go to next message
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 Go to previous message
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
Previous Topic: MS OLE DB Provider for ODBC Drivers error 80040e14 Getting Syntax error with this code: Can you hel
Next Topic: Strange. (please help : urgent)
Goto Forum:
  


Current Time: Tue Apr 23 04:42:34 CDT 2024