我想将游标和数据结构传递给一个过程,然后该过程用 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
我如何传递光标,我将如何定义数据结构参数?