Hello there,
Is it possibile to declare a cursor name through a host variable?

In Pro*C, something like:

EXEC SQL DECLARE :MyCursor CURSOR FOR SELECT [...]

I'm porting Informix SE ESQL Code to Pro*C, and I have to convert a lot of snippets just like this:

Code:
int TheFunction (long ID) {
        EXEC SQL BEGIN DECLARE SECTION;
        long MyID;
        ...
        ...
        EXEC SQL END DECLARE SECTION;

        sprintf(MyCursor, "C%ld", ID);
	
	EXEC SQL DECLARE :MyCursor CURSOR FOR SELECT x FROM ytable FOR UPDATE;
	EXEC SQL OPEN :MyCursor;
	while(TRUE)
	{
		EXEC SQL FETCH :MyCursor INTO :MyID;
		
		if (sqlca.sqlcode)
		{
			EXEC SQL CLOSE :MyCursor;
			return(FALSE);
		};
		if (TheFunction(MyID)...
As you see, the function is recursive and it seems to require a different cursor name for every recursion step.
Is it possible to adopt the same cursor name in every call to TheFunction?
Am I forced to pre-create a statement callable by EXECUTE IMMEDIATE, carefully changing cursor's name everytime?

Thanks in advance.