I'm new at slqunit and I'm trying to put the values returned by plsql into varibles (ie: ${out1}). The documentation says that if the variable is not setted the <resultset> or <outparam> tags will put the value into that variable:
Here is an extract of my test:
<stmt>{call PR_TEST_LLAMADA(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}</stmt>
<param id="1" name="i_call_id" type="VARCHAR" inout="in" is-null="false">${io_ani}</param>
<param id="2" name="i_ani" type="VARCHAR" inout="inout" is-null="false">356</param>
...
</stmt>
Then I need to put the value returned in the parameter whose id is 2 (because is inout) into a variable:
${out_ani} is not setted before, so according to http://sqlunit.sourceforge.net/x3359.html I think that the value returned should be placed into ${out_ani} and the comparison shouldn't be performed. But i've got this message:
[sqlunit] Assertion "outparams-equal" failed ${out_ani}(VARCHAR) != 124(VARCHAR) at outparams[0])
I understand that sqlunit is trying to compare the value given (${out_ani}) with the value returned (124).
Another way to do that (and it's working) is giving the variable within the <stmt> section (<param>) but if I do that I won't be able to give a value as a input parameter (because the variable has to be unsetted).
Fixed now, please download code fixes here and recompile. Alternatively, please download a fresh release from CVS and recompile. Thanks for catching the bug.
Checking in src/net/sourceforge/sqlunit/SymbolTable.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/SymbolTable.java,v <-- SymbolTable.java
new revision: 1.43; previous revision: 1.42
done
Checking in src/net/sourceforge/sqlunit/handlers/CallHandler.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/CallHandler.java,v <-- CallHandler.java
new revision: 1.14; previous revision: 1.13
done
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello:
I'm new at slqunit and I'm trying to put the values returned by plsql into varibles (ie: ${out1}). The documentation says that if the variable is not setted the <resultset> or <outparam> tags will put the value into that variable:
http://sqlunit.sourceforge.net/x3359.html
Here is an extract of my test:
<stmt>{call PR_TEST_LLAMADA(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}</stmt>
<param id="1" name="i_call_id" type="VARCHAR" inout="in" is-null="false">${io_ani}</param>
<param id="2" name="i_ani" type="VARCHAR" inout="inout" is-null="false">356</param>
...
</stmt>
Then I need to put the value returned in the parameter whose id is 2 (because is inout) into a variable:
<result>
<outparam id="2" type="VARCHAR" >${out_ani}</outparam>
...
<result>
${out_ani} is not setted before, so according to http://sqlunit.sourceforge.net/x3359.html I think that the value returned should be placed into ${out_ani} and the comparison shouldn't be performed. But i've got this message:
[sqlunit] Assertion "outparams-equal" failed ${out_ani}(VARCHAR) != 124(VARCHAR) at outparams[0])
I understand that sqlunit is trying to compare the value given (${out_ani}) with the value returned (124).
Another way to do that (and it's working) is giving the variable within the <stmt> section (<param>) but if I do that I won't be able to give a value as a input parameter (because the variable has to be unsetted).
<param id="2" name="i_ani" type="VARCHAR" inout="inout" is-null="false">${out_ani}</param>
${out_ani} must be unsetted.
if I set ${out_ani} before then the value is not put into ${out_ani}. ${out_ani} doesn't change its value!
Is there a way to rescue the returned values from an inout parameter?
Help PLEASE!
Hi Chabatox,
I think this may be a bug based on another thread "variables inside outparam". I will look at it and get back.
-sujit
Hi Chabatox,
Fixed now, please download code fixes here and recompile. Alternatively, please download a fresh release from CVS and recompile. Thanks for catching the bug.
Checking in src/net/sourceforge/sqlunit/SymbolTable.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/SymbolTable.java,v <-- SymbolTable.java
new revision: 1.43; previous revision: 1.42
done
Checking in src/net/sourceforge/sqlunit/handlers/CallHandler.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/CallHandler.java,v <-- CallHandler.java
new revision: 1.14; previous revision: 1.13
done
-sujit