Home > database >  Masters, the loop body cannot use cursor FOR loop? Why use the cursor, cycle will take??
Masters, the loop body cannot use cursor FOR loop? Why use the cursor, cycle will take??

Time:09-22

Masters, the loop body cannot use cursor FOR loop? Why use the cursor, cycle will take?? How to change to do it?
Note: for the outermost loop I
Online for the answer
String cz []
String ls_cln []
The integer k, li_count, I, j
String a
String fij
The integer li_rowcount
Li_count=integer (dw_pjb. Object. The datawindow. Column. Count)
Li_rowcount=dw_pjb. Rowcount ()//get dw_pjb the total number of rows
K=1
J=3
For I=2 to li_rowcount
Declare cz cursor for the select index proportion from zb order by index number using the sqlca.
The open cz;
The fetch cz into: cz [k].

The do while the sqlca. Sqlcode=0
A=cz [k]
Ls_cln [j]=dw_pjb. The describe (" # "+ string (j) +". The Name ")
Fij=ls_cln [j]
K=k + 1
J=j + 1

The fetch cz into: cz [k].
Loop
Commit the using the sqlca;
The close cz;
Commit the using the sqlca;
End the for

CodePudding user response:

Post, I find out
String cz []
String ls_cln []
The integer k, li_count, I, j
String a
String fij
The integer li_rowcount
Li_count=integer (dw_pjb. Object. The datawindow. Column. Count)
Li_rowcount=dw_pjb. Rowcount ()//get dw_pjb the total number of rows
K=1
J=3
For I=2 to li_rowcount
Declare cz cursor for the select index proportion from zb order by index number using the sqlca.
The open cz;
The fetch cz into: cz [k].

The do while the sqlca. Sqlcode=0
A=cz [k]
Ls_cln [j]=dw_pjb. The describe (" # "+ string (j) +". The Name ")
Fij=ls_cln [j]
K=k + 1
J=j + 1

The fetch cz into: cz [k].
Loop
The close cz;
End for
Commit the using the sqlca;

CodePudding user response:

Loop to close the cursor in the body