|
<< Click to Display Table of Contents >> Navigation: iVend Database Database > User Defined Functions > FunSplit User Defined Function |
Navigation: iVend Database Database > User Defined Functions >
iVend 6.6 Database Help
FunSplit User Defined Function
Collapse All Expand All
iVend Database Database : FunSplit User Defined Function |
Properties
Creation Date |
4/13/2015 12:00 PM |
Encrypted |
|
Ansi Nulls |
|
Parameters
Parameter |
Direction |
Description |
Data Type |
Size |
@String |
In |
|
VarWChar |
4000 |
@Delimiter |
In |
|
VarChar |
1 |
@TABLE_RETURN_VALUE |
Return Value |
Result table returned by table valued function |
Empty |
0 |
Procedure Source Code
-- ============================================= -- Author: Ritu Rawat -- Create date: 21 Jan 2008 -- Description: <Description,,> -- ============================================= CREATE function FunSplit (@String nvarchar(4000), @Delimiter char(1)) Returns @Results Table (Items nvarchar(100)) As Begin Declare @Index int Declare @Slice nvarchar(4000) Select @Index = 1 If @String Is NULL Return While @Index != 0 Begin Select @Index = CharIndex(@Delimiter, @String) If (@Index != 0) Select @Slice = left(@String, @Index - 1) else Select @Slice = @String Insert into @Results(Items) Values (@Slice) Select @String = right(@String, Len(@String) - @Index) If Len(@String) = 0 break End Return End |
See Also
© 2019 All Rights Reserved.
Send comments on this topic.