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: How to promt a user for input and get his input in pl/sql function

Re: How to promt a user for input and get his input in pl/sql function

From: Arjan van Bentem <avbentem_at_DONT-YOU-DARE-cable.a2000.nl>
Date: Thu, 23 Jul 1998 07:12:26 +0200
Message-ID: <6p6gng$8si$1@newton.a2000.nl>


I doubt it can be done, considering that PL/SQL code could be called by a trigger or some background process, making the input very difficult. If you insist, I guess you need to use DBMS_PIPE and a Unix program that listens to that pipe.

When you're using SQL*Plus to run the PL/SQL script, then you may be able to use SQL*Plus ACCEPT for the user input. But that needs to be done outside your PL/SQL blocks, and thus outside any PL/SQL function. Like:

variable rember_this varchar2(12)
variable remeber_this_too number
begin
  .. some code
  :remember_this := .. ;
  :remember_this_too := .. ;
end;
/

accept my_var prompt Enter a value for my_var

begin
  here you can use &my_var, :remember_me and :remember_me_too end;
/

If you need to remember a lot of parameters, put them in some table.

Arjan. Received on Thu Jul 23 1998 - 00:12:26 CDT

Original text of this message

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