我想将游标和数据结构传递给过程,然后过程使用sql游标的下一行填充结构。这可能吗?下面是我试图达到的模板。使用RPG变量作为游标名称执行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
我该如何传递光标,以及如何定义数据结构参数?
谢谢,我注册了他们 – jax 2011-06-15 22:51:40