在存储过程中创建游标老是报错,[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 吧
------解决方案--------------------------------------------------------