Home » SQL & PL/SQL » SQL & PL/SQL » use value of one variable as a name of the second variable
use value of one variable as a name of the second variable [message #2614] Wed, 31 July 2002 04:49 Go to next message
OAK
Messages: 2
Registered: July 2002
Junior Member
I have three variables: x1,x2,x3
x1 := 'a';
x2 := 'x1';
x3
I would like to now if I can assign value of variable x1 to x3 with help of variable x2.
Something like that:
x3 := ????? x2 and I want the value of variable x3 to be 'a'

Has anyone any idea?
Re: use value of one variable as a name of the second variable [message #2617 is a reply to message #2614] Wed, 31 July 2002 05:12 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> ed
Wrote file afiedt.buf

  1  declare
  2  x1 varchar2(1):='a';
  3  x2 varchar2(1);
  4  x3 varchar2(1);
  5  begin
  6  x2:=x1;
  7  x3:=x2;
  8  dbms_output.put_line('the value of x1 : '||x1);
  9  dbms_output.put_line('the value of x2 : '||x2);
 10  dbms_output.put_line('the value of x2 : '||x2);
 11* end;
 12  /
the value of x1 : a
the value of x2 : a
the value of x2 : a

PL/SQL procedure successfully completed.

Previous Topic: Creating a temp table and unique numbering
Next Topic: error when I send email from a stored procedure
Goto Forum:
  


Current Time: Thu Apr 25 19:41:49 CDT 2024