<p>I have found an issue with the DataSet builder in Actuate/BIRT4.4.0, let's see if others agree:</p>
<p> </p>
<p>Symptom: i call a stored procedure "sp10" expecting 32 rows, 10 columns returned, and obtain 32 x 1 column. I see this in the DataSet preview.</p>
<p> </p>
<p>On digging into it I find the sp10 sproc, calls another, "SpN" that, depending on the value of an integer field "fieldN" passed to it, may return 1, 2, 3, ...10+ columns of data. </p>
<p> </p>
<p>It therefore seems that the DataSet, on requesting what output fields will be returned, takes the<u> first </u>output of 1 column, and states that is all that any of the sp1,sp2,..sp10 sprocs can ever return. So it is ignoring the fact that sp10 explicitly passes in fieldN=10, it just uses whatever the first select returns, in this case 1 column. (It fills that 1 column with the data for fieldN=10 by the way, hence the 32 rows returned. Fortunately in this case the first column was always an integer.)</p>
<p> </p>
<p>I will now re-write my sprocs so they are independent, they won't use spN, I know that will fix the problem.</p>
<p> </p>
<p>The offending SQL is below, to use it just try creating a DataSet calling the spN5 sproc; i only get 1 column as output. But if you run spN5 outside of BIRT it will return 5 columns.</p>
<p> </p>
<p>----</p>
<div>IF exists(select * from sysobjects where name = 'spN')</div>
<div>DROP PROC spN</div>
<div>GO</div>
<div>print 'spN'</div>
<div>GO</div>
<div> </div>
<div>CREATE PROCEDURE spN (
@fieldN int = 0 )</div>
<div>AS</div>
<div>BEGIN</div>
<div> </div>
<div>
</div>
<div>if (
@fieldN = 1)</div>
<div>begin</div>
<div> select myInteger=1</div>
<div> return</div>
<div>end</div>
<div>
</div>
<div>if (
@fieldN = 5 )</div>
<div>begin</div>
<div> select fieldNum=
@fieldN, ThisStr='This', DoesStr=' does', NotStr=' not', WorkStr=' work.'</div>
<div> return</div>
<div>end</div>
<div>
</div>
<div>END </div>
<div>GO</div>
<div> </div>
<div>IF exists(select * from sysobjects where name = 'spN5')</div>
<div>DROP PROC spN5</div>
<div>GO</div>
<div>print 'spN5'</div>
<div>GO</div>
<div>CREATE PROCEDURE spN5</div>
<div>AS</div>
<div>BEGIN</div>
<div>exec spN 5</div>
<div>end</div>
<div>go</div>
<div> </div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>