当前位置: 代码迷 >> DB2 >> DB2中创建游标解决思路
  详细解决方案

DB2中创建游标解决思路

热度:4004   发布时间:2013-02-26 00:00:00.0
DB2中创建游标
在存储过程中创建游标老是报错,[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "p2: begin" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<space>". SQLSTATE=42601
单独在外面写也报错,在存储过程里面写也报错,郁闷了,啥原因呢?创建游标:
SQL code
p2: begin   declare cursor1 cursor for   select * from OTS.CUST_INFO_ODM;  open cursor1; end p2; 


------解决方案--------------------------------------------------------
SQL code
begin   declare cursor1 cursor for   select * from OTS.CUST_INFO_ODM;  open cursor1; end
------解决方案--------------------------------------------------------
似乎是 declare cursor cursor1 for 吧
------解决方案--------------------------------------------------------
探讨

似乎是 declare cursor cursor1 for 吧
  相关解决方案