Idocscript を使用して ResultSet の行数を見つけようとしています。以下のように ResultSet をループする以外に最適な方法はありますか?
<$sampleRSLength=0$>
<$if rsExists("sampleResultSet")$>
<$loop sampleResultSet$>
<$sampleRSLength=sampleRSLength+1$>
<$endloop$>
<$endif$>
Idocscript を使用して ResultSet の行数を見つけようとしています。以下のように ResultSet をループする以外に最適な方法はありますか?
<$sampleRSLength=0$>
<$if rsExists("sampleResultSet")$>
<$loop sampleResultSet$>
<$sampleRSLength=sampleRSLength+1$>
<$endloop$>
<$endif$>
IdocScriptリファレンス ガイドを詳しく読んだ後、自分で答えを見つけることができました。
Idocscript にはrsNumRows()
、結果セットの行数を取得するために使用できるメソッドがあります。
<$if rsExists("sampleResultSet")$>
<$sampleRSLength=rsNumRows("sampleResultSet")$>
<$endif$>