![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Everybody, Is posible to create dynamic variables in a PL/SQL procedure? (snip) 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? |
#3
| |||
| |||
|
|
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 |
utarray(1) := salary;
utarray(2) := discount;
utarray(3) := net;
#4
| |||
| |||
|
#5
| |||
| |||
|
|
mgmonzon wrote: Hi Everybody, Is posible to create dynamic variables in a PL/SQL procedure? (snip) 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? No. This is not possible. (As in all other programming languages I know.) Why would you want to do such a thing? It doesn't make too much sense too me :-) best, Martin |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
I'm trying to create a application where the users can define his own calculations. Regards, Mgmonzon |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
I'm working in a payroll application where the user can implement any rule of calculation using a formula definition page. The actual application make the calculation using a program created in VB and we want eliminate all the VB code in order to make the application transportable. Regards, Mgmonzon |
![]() |
| Thread Tools | |
| Display Modes | |
| |