Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> create dynamic variables
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 ;
Is possible do that?
Mgmonzon Received on Wed Aug 09 2006 - 10:27:03 CDT