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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL get user input ???

Re: PL/SQL get user input ???

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Tue, 22 Jun 1999 03:44:09 GMT
Message-ID: <377a01c1.12329578@netnews.worldnet.att.net>


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



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Mon Jun 21 1999 - 22:44:09 CDT

Original text of this message

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