Home > database >  Who can help me have a look at why the cursor infinite loop?
Who can help me have a look at why the cursor infinite loop?

Time:09-29

Description: the sqlca and remotesql database on two different machines

Int I
I=1
DECLARE my_cursor CURSOR FOR
The select segmentBegin segmentEnd, bl, typeflag
The from HospitalRule
Where audityear=: for_year order by segmentBegin using remotesql;
The OPEN my_cursor;
The FETCH my_cursor INTO: fd_segmentBegin [I], : fd_segmentEnd [I], : bd_bl [I], : bd_type [I];
The Do While the SQLCA. SQLCode=0
{//processing operations}
The FETCH my_cursor INTO: fd_segmentBegin [I], : fd_segmentEnd [I], : bd_bl [I], : bd_type [I];
Loop
The CLOSE my_cursor;

Run after the program has been the do while loop not out, finally cause the array bounds, and only two records in the SQL statement,

CodePudding user response:

Sorry, committing a category of low-level mistakes, loop condition should be: Do While remotesql. SQLCode=0

CodePudding user response:

Ha ha, the database even wrong

CodePudding user response:

Up,,,,

CodePudding user response:

You this is wrong, your object is a REMOTESQL things, one thing the SQLCA,
This must be wrong,

CodePudding user response:

 int I 
I=1
DECLARE my_cursor CURSOR FOR
The select segmentBegin segmentEnd, bl, typeflag
The from HospitalRule
Where audityear=: for_year order by segmentBegin using remotesql;
The OPEN my_cursor;
The FETCH my_cursor INTO: fd_segmentBegin [I], : fd_segmentEnd [I], : bd_bl [I], : bd_type [I];

The Do While remotesql. SQLCode=0
{//processing operations}
The FETCH my_cursor INTO: fd_segmentBegin [I], : fd_segmentEnd [I], : bd_bl [I], : bd_type [I];
Loop
The CLOSE my_cursor;

CodePudding user response:

A lot of errors is carelessness

CodePudding user response:

I will also make similar mistakes
  • Related