免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4347 | 回复: 5
打印 上一主题 下一主题

REPORT 报错:ORA-01002 fetch out of sequence [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-07-16 12:06 |只看该作者 |倒序浏览
用DEVELOPER 2000  form 4.5 +report  2.5 做的程序, ORACLE 816 数据库,在运行某个报表时, 选择某个条件时,报错如下: 
     ORA-01002 fetch out of sequence
     (中文错为: ORA-01002  读取违反顺序 )

    但不是所有的条件都报错,如在200307月会报此错,但在
200306月份,却不会报错.
    类似情况:
   有的报表可以运行出来,但在翻页时,翻到中间某一页时,才报此错.

   我将数据导出来,导到其它的机器中,却没有问题.
   有时过几天,再打印又可以; 有时换一台工作站,又可以了;
   但现在我碰到的情况,连重启数据库也不行, 千万别要我重装数据库呀???


      请教各位大虾,有什么好的方法,要怎样做才能避免此问题.Thanks  a lot !!!

论坛徽章:
0
2 [报告]
发表于 2003-07-16 12:23 |只看该作者

REPORT 报错:ORA-01002 fetch out of sequence

找到该表要用到sequence的列的最大值
重建sequence对象,并设初始值为最大值+1000

论坛徽章:
0
3 [报告]
发表于 2003-07-16 12:33 |只看该作者

REPORT 报错:ORA-01002 fetch out of sequence

谢谢,能否举一个例子,如何找到其sequence,及如何设置.

论坛徽章:
0
4 [报告]
发表于 2003-07-16 12:38 |只看该作者

REPORT 报错:ORA-01002 fetch out of sequence

用SYSTEM/MANAGER登陆
然后通过DBA_OBJECTS找到sequence,
drop sequence sequence_name
CREATE SEQUENCE seq_name INCREMENT BY ? START WITH 1
    MAXVALUE 1.0E27 MINVALUE 1 NOCYCLE
    CACHE 20 NOORDER
打‘?’的地方填写初始值

论坛徽章:
0
5 [报告]
发表于 2003-07-16 14:34 |只看该作者

REPORT 报错:ORA-01002 fetch out of sequence

我在数据库中没有建立其它的顺序号,我这样建立一个顺序号,有作用吗?
   我在程序中及报表中都没有使用顺序号.
如下:
CREATE SEQUENCE  SQ_ND_SCXX  INCREMENT BY 1000
     START WITH 1
     MAXVALUE 1.0E27
     MINVALUE 1 NOCYCLE
    CACHE 20 NOORDER ;



  谢谢!!!

论坛徽章:
0
6 [报告]
发表于 2003-07-16 16:26 |只看该作者

REPORT 报错:ORA-01002 fetch out of sequence

01002, 00000, "fetch out of sequence"
// *Cause: This error means that a fetch has been attempted from a cursor
//         which is no longer valid.  Note that a PL/SQL cursor loop
//         implicitly does fetches, and thus may also cause this error.
//         There are a number of possible causes for this error, including:
//         1) Fetching from a cursor after the last row has been retrieved
//            and the ORA-1403 error returned.
//         2) If the cursor has been opened with the FOR UPDATE clause,
//            fetching after a COMMIT has been issued will return the error.
//         3) Rebinding any placeholders in the SQL statement, then issuing
//            a fetch before reexecuting the statement.
// *Action: 1) Do not issue a fetch statement after the last row has been
//             retrieved - there are no more rows to fetch.
//          2) Do not issue a COMMIT inside a fetch loop for a cursor
//             that has been opened FOR UPDATE.
//          3) Reexecute the statement after rebinding, then attempt to
//             fetch again.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP