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: Kenneth C Stahl <kstahl_at_lucent.com>
Date: Tue, 22 Jun 1999 08:10:35 -0400
Message-ID: <376F7D3B.461E1238@lucent.com>


I have found that I can do this with utl_file by using utl_file.fopen to open /dev/stdin for reading. Don't know if all versions of unix have that. It is the same as /dev/fd/1 on Unixware 2.1.2. This probably is not portable, but it does work under that version and I know it also works under NCR SVR4 4.2.

Ken

Jonathan Gennick wrote:

> 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.
>
>
Received on Tue Jun 22 1999 - 07:10:35 CDT

Original text of this message

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