针对HANA 102.5执行时,以下批处理
CREATE PROCEDURE DUMMY( message nvarchar(254) )
AS
BEGIN
/* Do nothing */
END;
CREATE PROCEDURE cur_test
AS CURSOR cur FOR
SELECT 'code' FROM DUMMY;
code NVARCHAR(64);
BEGIN
OPEN cur;
CALL DUMMY( 'Start' );
WHILE 1 = 1 DO SEQUENTIAL EXECUTION
FETCH cur INTO code;
BREAK;
END WHILE;
CALL DUMMY( 'Finish' );
CLOSE cur;
END;
CALL cur_test;
因错误而失败:
SqlScript: Unsupported type of lhs:CUR:unknown type
为什么会这样?请注意,当我删除对DUMMY
的任一调用时,它都有效。当我评论FETCH
语句时,它也有效。删除WHILE
循环并单独留下身体也会使错误消失。