Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> create dynamic variables

create dynamic variables

From: mgmonzon <mgmonzon_at_gmail.com>
Date: 9 Aug 2006 08:27:03 -0700
Message-ID: <1155137222.971694.295790@i3g2000cwc.googlegroups.com>


Hi Everybody,

Is posible to create dynamic variables in a PL/SQL procedure?

This is my problem, I have a table called TABLE_VARIABLE with this values :

# VAR_NAME VAR_VALUE

------- --------------- ------------------------
1	SALARY		1000
2	DISCOUNT	300
3	NET		(SALARY - DISCOUNT)


I want create a procedure where the variables names should be the same name defined in the table TABLE_VARIABLE. The user is able to create ne records and new variables names an the names should be processed like a pl/sql variables in order to store the result information in other table.

Sample :

Create or replace read_variables as
Begin

	for reg in (select VAR_NAME, VAR_VALUE from TABLE_VARIABLE ) loop

<create variable defined in the field VAR_NAME in TABLE_VARIABLE> ;
<Assign value using the field VAR_VALUE in TABLE_VARIABLE> ;
End Loop ;

End ;

Is possible do that?

Mgmonzon Received on Wed Aug 09 2006 - 10:27:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US