首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > IBM DB2 >

DB2中创建游标解决思路

2012-04-04 
DB2中创建游标在存储过程中创建游标老是报错,[IBM][CLI Driver][DB2/NT] SQL0104NAn unexpected token p2

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 吧

热点排行