How to find length of ResultSet using IdocScript in Oracle UCM?

213 views Asked by At

I am trying to find number of rows in a ResultSet using idocscript. Is there an optimal way of doing other than looping through the ResultSet as below?

<$sampleRSLength=0$>
<$if rsExists("sampleResultSet")$>
  <$loop sampleResultSet$>
    <$sampleRSLength=sampleRSLength+1$>
  <$endloop$>
<$endif$>
2

There are 2 answers

0
vk239 On BEST ANSWER

I was able to find the answer myself after reading through the IdocScript reference guide in detail.

Idocscript has a method rsNumRows() which can be used for getting number of rows in a result set.

<$if rsExists("sampleResultSet")$>
 <$sampleRSLength=rsNumRows("sampleResultSet")$>
<$endif$>
0
William Phelps On
<$sampleResultSet.#numRows$>

will also work.