Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL get user input ???
On Mon, 21 Jun 1999 04:00:35 GMT, scott.daniels_at_ieee.org
wrote:
>Can anyone give me a hint on how to get user input using a
>PL/SQL program under Oracle 8 ?
>I tried dbms_output.get_LINE(...) BUT THE PROGRAM JUST SKIPS
>past that line of code and never pauses for my input.
GET_LINE doesn't do what you are thinking. PL/SQL can't directly accept input from the user. If you are doing this from a SQL*Plus script, you can have SQL*Plus get the input for you. Here's a short example:
ACCEPT my_var PROMPT 'Enter a string>'
SET SERVEROUTPUT ON
BEGIN
DBMS_OUTPUT.PUT_LINE('&&my_var');
END;
/
The double-ampersand is necessary, and tells SQL*Plus to replace the &&my_var with the string that you entered.
If you are executing your PL/SQL code some other way, not using SQL*Plus, the above won't help.
regards,
Jonathan Gennick
![]() |
![]() |