Hi all,
what i would like to do is make a cursor in a cursor,
i did this but it works only a part.
He loops the first cursor onces,then goes to the second cursor and loops this as much as needed,but then
it doesn't return to the first cursor
what am i doing wrong or is this not possible?
CODE:
what i would like to do is make a cursor in a cursor,
i did this but it works only a part.
He loops the first cursor onces,then goes to the second cursor and loops this as much as needed,but then
it doesn't return to the first cursor
what am i doing wrong or is this not possible?
CODE:
Code:
______________________________________________
iteratieweergeven2.
EXEC SQL
DECLARE maarten4 CURSOR FOR
SELECT iteratieID
FROM iteratie
WHERE projectID = :ws-projectID
END-EXEC.
EXEC SQL
OPEN maarten4
END-EXEC
perform until sqlstate = '02000'
exec sql
fetch maarten4
into :duur1
end-exec
IF SQLSTATE = '02000'
EXIT PERFORM CYCLE
else
ADD 1 TO teller4
DISPLAY "Iteratie met ID:"+teller4
perform GETTAKEN2
end-if
end-perform
display "druk op een toets om door te gaan"
accept pauze
GETTAKEN2.
EXEC SQL
DECLARE taken1 CURSOR FOR
SELECT taakID
FROM taak
WHERE iteratieID = :teller4
END-EXEC.
EXEC SQL
OPEN taken1
END-EXEC
perform until sqlstate = '02000'
exec sql
fetch taken1
into :ws-tknr
end-exec
IF SQLSTATE = '02000'
DISPLAY "Aantal taken voor deze iteratie:"+teller5
EXIT PERFORM CYCLE
else
ADD 1 TO teller5
end-if
end-perform
______________________________________