1. 15:49:23 ORA-01002: fetch out of sequence
the number of records to be fetch is incorrect (for example, there are 8 records but 9 records are fetch)
PS:
. is commit; cause error
when you open a cursor with for update, the system will apply exclusive lock to the retrieved data ),
before the lock is released, other users cannot update, delete, or lock these records.
once I execute commit, the lock is released, the cursor becomes invalid, and an error occurs when I fetch the data.
therefore, you need to put the commit outside the loop, wait until all data processing is complete, and then commit, and then close the cursor
B. cursor cur is select * from table for update;
it's okay to comment out for update, but it's strange that for update is used in other places.
2. 15:49:23 ORA-01002: invalid rowid
records are cleared when the temporary table commit is used.
because the record is empty (but you want to use a cursor ), the row cannot be found. The temporary table is changed to: On commit preserve rows
PS:
● On commit Delete rows table name rows are only visible during the transaction
● On commit preserve rows table name rows are visible during the entire session
3. 19:36:09 ORA-06502: PL/SQL: numeric or value error
varchar type, the assigned value exceeds the defined length.
for example, declare HH varchar2 (4000);
hh: = mm | nn; -- Mm 3564, NN 600
PS:
Possible reasons:
1. if it is an in parameter, it may be that the parameter is assigned a variable with a relatively small length during the process. As a result, the variable cannot store the passed variable value.
2. if it is an out parameter, it may be that the length of the parameter definition in the call process is not enough, that is, it is smaller than the length of the parameter value in the process.
3. A general numeric Conversion error occurs. For example, you can convert a string containing non-numbers to a number.