Hi All,
I am trying to create a same below function created in MS-SQL in HANA. I not able to achieve this creation.
Can anyone please help me with converting the same into HANA.
MS-SQL Function
--------------------------
Create Function fnSplitter (@IDs Varchar(4000) )
Returns @Tbl_IDs Table (ID nvarchar(100) COLLATE SQL_Latin1_General_CP1_CS_AS ) As
Begin
Set @IDs = @IDs + ','
Declare @Pos1 Int
Declare @Pos2 Int
Set @Pos1=1
Set @Pos2=1
While @Pos1<Len(@IDs)
Begin
Set @Pos1 = CharIndex(',',@IDs,@Pos1)
Insert @Tbl_IDs Select Substring(@IDs,@Pos2,@Pos1-@Pos2)
Set @Pos2=@Pos1+1
Set @Pos1 = @Pos1+1
End
Return
End
Thanks
Muralidhar