0

针对 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循环并单独留下主体也会使错误消失。

4

0 回答 0