In short, no. Perhaps with Java (i'm not sure), but definitely not with
PL.SQL. There are a couple of things you can do depending on what you're
trying to accomplish.

Prompt for input in sqlplus before executing your pl/sql. If you're running
a stored procedure, pass the input as an argument. If you're running
anonymous pl/sql, embed the substitution variable in the pl/sql where you
need it.

If you need to prompt after executing some logic, don't use pl/sql. Use a
shell script to do what you want and issue sql commands against the database
via sqlplus. You can read results from a sql command into shell variables
like this.

#!/bin/ksh
print -n "Enter table name:"
read tn
sqlplus -s<<! | read cnt
user/password
set feedback off pages 0 trimspool on
select count(*) from $tn;
!
print "Count is $cnt"

----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 9:50 AM


> Hi All,
>
> Is there a way to prompt a user and accept input from the user inside a
> procedure. I cannot get the prompt/accept to work
> inside a procedure. It works it sql*plus.
>
> Thanks
> Rick
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Cale, Rick T (Richard)
>   INET: [EMAIL PROTECTED]
>
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
>
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Chuck Hamilton
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to