Home » RDBMS Server » Server Administration » How to use sql*plus to interactive with user?
How to use sql*plus to interactive with user? [message #370153] Mon, 25 December 2000 07:27 Go to next message
Kevin J.
Messages: 3
Registered: October 2000
Junior Member
Hi :
I want to write scripts in sql*plus to interactive with user :
accept ans promt 'pls input your answer :'
begin
if :ans='1' then
-- do something
else
-- do other things
end if;
end;
/
How can I make it
Re: How to use sql*plus to interactive with user? [message #370155 is a reply to message #370153] Mon, 25 December 2000 22:38 Go to previous messageGo to next message
Balasubramanian.C
Messages: 5
Registered: November 2000
Junior Member
hi,
try and use substitution variable like '&' (ampersand)
Re: How to use sql*plus to interactive with user? [message #370156 is a reply to message #370153] Mon, 25 December 2000 22:46 Go to previous message
P. Lavanya
Messages: 8
Registered: November 2000
Junior Member
Hi,

Try this:

SQL> PROMPT 'PLEASE INPUT YOUR ANSWER:'
SQL> ACCEPT ANS
SQL> BEGIN
SQL> IF '&ANS' = '1' THEN
SQL> ------
SQL> ELSE
SQL> -----
SQL> END IF;
SQL> END;

lavP
Previous Topic: How to find all the sequences I have created?
Next Topic: sqlplus query
Goto Forum:
  


Current Time: Thu May 16 23:15:03 CDT 2024