Bind Variable not Working for Default Values in Template

MikeTh

Member
I have a Problem with Default Values that execute a Select and have Bind Variables in it.

Her ist a example how it can work with "list" instand of "default":

Code:
[$WINDOW TYPE = SQL]
SELECT &<NAME="UsedVar" LIST="1,2,3,4,5" TYPE="integer"> + &<NAME="ProblemVar" TYPE="integer" LIST="select :UsedVar from dual"> FROM dual;

the Example is working. Same Example with "default" instant of "list":

Code:
[$WINDOW TYPE = SQL]
SELECT &<NAME="UsedVar" LIST="1,2,3,4,5" TYPE="integer"> + &<NAME="ProblemVar" TYPE="integer" DEFAULT="select :UsedVar from dual"> FROM dual;

this only brings up this:

"ProblemVar: Error executing SELECT statement:
ORA-01008: Nicht allen Variablen ist ein Wert zugeordnet"

How can i use a bind Variable in Default? Is there a way to do it?
 
The DEFAULT option does indeed not support bind variable values. The problem is that the default value is determined and displayed when the variable form is first displayed. Therefore the default expression cannot refer to other variable values.

For the IFEMPTY option this would theoretically be possible, because this value is applied after submitting the variable form. I noticed however that the IFEMPTY expression does not parse bind variables. I have added this to the list of enhancement request.
 
Back
Top