Re: PL/SQL ACCEPT command: how does it work?
Date: Wed, 6 Sep 2000 09:19:23 +0100
Message-ID: <R5nt5.21312$r4.11238_at_news.indigo.ie>
[Quoted] the accept coomand prompts the user for an input and stores the result in a [Quoted] sqlplus substitution variable, similiar to the ones created by define
[Quoted] so if i do
[Quoted] SQL> accept x prompt 'Enter Value: '
Enter Value: 123
[Quoted] SQL> select &x from dual;
123
123
SQL> [Quoted] the variable command creates a bind variable, this can be set in a number of ways
[Quoted] execute :x := '123';
begin
:x := '123';
end;
[Quoted] create procedure test(myvar varchar out)
is
begin
myvar :='123';
end;
[Quoted] execute test(:x);
HTH Conan
[Quoted] Cristian Veronesi wrote in message <39B5F5A8.C5D26C91_at_crpa.it>... Why the user input is not stored into the variable?
- file p.sql ------
[Quoted] variable x varchar2(20)
accept x prompt 'x: '
print x
[Quoted] SQL> start p
x: 3
X
SQL>
-- Cristian Veronesi ><((((ยบ> http://www.crpa.it [Quoted] Haste is of the devil, and tardiness from the All-Merciful (oriental proverb)Received on Wed Sep 06 2000 - 10:19:23 CEST