Hi,
Does anyone know that there is a work around for recursive function call?
Read following 4GL program
function recursive_call()
declare c_cursor cursor for
select * from any_table
where any_field = any_criterion
foreach c_cursor into pr_any_table.* # pr_any_table record like any_table.*
if something_ok then
call recursive_call()
else
call do_else()
end if
end foreach
free c_cursor
end function
The problem in this function is that when the function is called second time
recursively and finish foreach loop, it close the cursor c_cursor. At same
time, it closes the cursor opened when the function was called first time.
So, When control returns to first layer and fetchs the cursor again, error
-400 occurs ("Fetch attempted on unopen cursor"). If anyone has workaround,
would you please let me share?
If Informix reads this mail and can not give us a solution, please add it
in later version.
My environment is 4GL version 4.10.UC3
SQL version 4.10.UD2
on SCO UNIX 3.2.2
Tony Yang (714)771-0454
Data Systems Support
yang@dssmktg.com; bangpath - uunet.uu.net!dssmktg!yang