Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to promt a user for input and get his input in pl/sql function
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
![]() |
![]() |