我有以下 HANA 程序:
CREATE PROCEDURE SP_LIT()
AS
BEGIN
DECLARE count INT;
DECLARE pos INT;
DECLARE value NVARCHAR(100);
value := 'R,A';
IF LENGTH(:value) > 0 THEN
value := :value + ',';
pos := LOCATE(:value,',',1);
END IF;
WHILE :pos > 0 DO
BEGIN
INSERT INTO [O/P table] VALUES (LEFT(:value,:pos-1));
value := RIGHT(:value, LENGTH (:value)-:pos);
pos := LOCATE(:value,',',1);
END;
END WHILE;
END;
一切似乎都很好,但在执行时会引发以下错误:
Error: invalid number exception: invalid number: not a valid number string 'R,A'
知道我哪里错了吗?