カーソルとデータ構造をプロシージャに渡したいのですが、プロシージャはSQLカーソルから次の行を構造に取り込みます。これは可能ですか?私が達成しようとしているもののテンプレートを以下に示します。
*****************************************************
*
* Fetch the next row from a cursor
*
* @param cursor - the name of the cursor
* @param structure - the data structure to hold the fields
*****************************************************
pfetchNextRow B
DfetchNextRow PI N
d cursor 32767A varying const
d structure DS ???????
/free
exec sql
fetch next from :cursor into :structure
;
if (sqlstate = SQL_SUCCESS);
return *on;
else;
exec sql
close :cursor;
return *off;
endif;
/end-free
pfetchNextRow E
どのようにカーソルを渡す必要がありますか?また、データ構造パラメーターをどのように定義しますか?