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: prompting user for a value in PL/SQL procedure

Re: prompting user for a value in PL/SQL procedure

From: <markp7832_at_my-deja.com>
Date: Wed, 05 Apr 2000 14:00:58 GMT
Message-ID: <8cfguh$r45$1@nnrp1.deja.com>


In article <38eb39ab$1_at_usenet.ugsolutions.com>,   "Chul Kim" <kimc_at_ugsolutions.com> wrote:
> Is there a way to prompt the user who is executing a procedure for a
value?
> ACCEPT doesn't seem to work.
>
> Thank you.
>

Accept is an SQL*Plus command. You can prompt in anonymous pl/sql just as you can in sqlplus using the &variable format.

If you want or need to store the procedure then you need to pass the parameter to pl/sql as a bind variable.

set echo off
rem
rem Sample SQL and PL/SQL passing variable to SQL*Plus from PL/SQL rem
variable v_charfld number
begin
select count(*)
into :v_charfld
from sys.dual
;
end ;
/
print v_charfld

I hope this helps.

--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Apr 05 2000 - 09:00:58 CDT

Original text of this message

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