Home » SQL & PL/SQL » SQL & PL/SQL » Select Variable
Select Variable [message #19565] Thu, 28 March 2002 12:07 Go to next message
Neil Jackson
Messages: 2
Registered: March 2002
Junior Member
Hi,

I'm new to Oracle but use another well know database where it is very easy to select the value of a variable to the screen, I was hoping some could give me a clue how to do something similar to below:

Thanks in advance
Neil

SQL>declare @testOutput varchar(20);
2 select @testOutput = 'hello';
3 select @testOutput;
4 /

hello

SQL>
Re: Select Variable [message #19567 is a reply to message #19565] Thu, 28 March 2002 12:34 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
sql> var testoutput varchar2(10);
 
sql> exec :testoutput := 'hello';
 
PL/SQL procedure successfully completed.
 
sql> print testoutput
 
TESTOUTPUT
--------------------------------
hello
Previous Topic: variables in where clause
Next Topic: Execute Package.Function
Goto Forum:
  


Current Time: Sat Apr 20 04:07:32 CDT 2024