When executed against HANA 102.5, the following batch
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;
fails with the error:
SqlScript: Unsupported type of lhs:CUR:unknown type
Why does this happen? Notice that when I remove either call to DUMMY
it works. When I comment the FETCH
statement it works as well. Removing the WHILE
loop and leaving the body alone also makes the error disappear.