在oracle8.0中对记录加锁为何提示"ora-01002 越顺存取",而在oracle7.3中可以,语句如下:
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.text:='select * from test_tab1 for update ');
 adoquery1.Open;
该语句是否有错,怎样修改?

解决方案 »

  1.   

    adoquery1.SQL.text:='select * from test_tab1 for update ');是否应该为:adoquery1.SQL.add('select * from test_tab1 for update ');
      

  2.   

    Cause: In a host language program, a FETCH call was issued out of sequence.
    A successful parse-and-execute call must be issued before a fetch. This can
    occur if an attempt was made to FETCH from an active set after all records have
    been fetched. This may be caused by fetching from a SELECT FOR UPDATE
    cursor after a commit. A PL/SQL cursor loop implicitly does fetches and may
    also cause this error.
    Action: Parse and execute a SQL statement before attempting to fetch the data.