HANA SQL function to split a comma delimited string into substrings -
i have following hana procedure:
create procedure sp_lit() begin declare count int; declare pos int; declare value nvarchar(100); value := 'r,a'; if length(:value) > 0 value := :value + ','; pos := locate(:value,',',1); end if; while :pos > 0 begin insert [o/p table] values (left(:value,:pos-1)); value := right(:value, length (:value)-:pos); pos := locate(:value,',',1); end; end while; end;
everything seems fine on execution following error thrown:
error: invalid number exception: invalid number: not valid number string 'r,a'
any idea going wrong?
i found solution. '+' sign in concatenation should replaced '||' pipe operator.
Comments
Post a Comment