E9.1 SV File IO Status always Success

JDE_MP

Active Member
Hi All,

I am trying to do a select, fetch next on a table. And while file io status is success, I am doing a fetchSingle on another table. If the File IO status of this fetchsingle is not success, then I have to do some calculations. But the file io status is always success even if the fetchsingle doesn't retrieve any data. I figured out that it could be due to the while loop. So how do we handle the fetchsingle inside the while loop? Is there a way the file io status be in error if the fetchsingle fails?

Thanks in advance.
 
your code should be

select on table A
fetch next on table A
While SV file IO is equal to success

fetch single on table A
if SV file IO is not success
do stuff
endif

fetch next on table A
End While
 
Why don’t you paste you ER code here so we can look at it0
your code should be

select on table A
fetch next on table A
While SV file IO is equal to success

fetch single on table A
if SV file IO is not success
do stuff
endif

fetch next on table A
End While
Unless using a table handle on the fetch single (if in fact same table) then the fetch single can break the while loop.
 
Thanks for the replies guys. I was just using a select statement in the while loop which was causing the issue. I did a select fetchnext in the while loop and it's working fine now.
 
Back
Top