我想將遊標和數據結構傳遞給過程,然後過程使用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