Hello again,
I am having a strange issue with a nested loop. I have used nested loops in this kind of situation in php/mysql more times than I remember so I'm not sure why this wouldn't work:
When debugging, everything works until we fetch next from c2. Then the sqlstt = 22002 which has the meaning of "A null value, or the absence of an indicator parameter was detected; for example, the null value cannot be assigned to a host variable, because no indicator variable is specified."
I've been searching all over the interwebs for a situation like this and there's no easy way to get the info from the second stored procedure into the first.
Thanks
I am having a strange issue with a nested loop. I have used nested loops in this kind of situation in php/mysql more times than I remember so I'm not sure why this wouldn't work:
PHP Code:
/free
exec SQL close c1;
exec SQL call storedproc1();
exec SQL associate result set locator (:rsltRecs) with procedure storedproc1;
exec SQL fetch next from c1 into :openRec;
dow sqlstt='00000'
custnum = openRec.cust#;
exec SQL close c2;
exec SQL call storedproc2(:custnum);
exec SQL associate result set locater (:mgrsRecs) with procedure storedproc2;
exec SQL fetch next from c2 into :mgrRec;
dow sqlstt='00000';
otherstuff = mgrRec.otherstuff;
exec SQL fetch next from c2 into :mgrRec;
enddo;
exec SQL fetch next from c1 into :openRec;
enddo;
/end-free
I've been searching all over the interwebs for a situation like this and there's no easy way to get the info from the second stored procedure into the first.
Thanks
Comment