Equivalent split function |
| santhosh kapa replied to Umair Imran at 04-Mar-08 05:22 |
try out this function to get the comma seperated string in the form of table and iterate it in the loop to get each value
FUNCTION getstringintableform (tempstr IN VARCHAR2, separator IN CHAR)
RETURN getstringintableform_temptab
IS
temp getstringintableform_tempobj ;
tempstr_ VARCHAR2 (32000) := tempstr;
separator_ CHAR (1) := separator;
separator_position NUMBER (10, 0);
tmptab getstringintableform_temptab
:= getstringintableform_temptab
();
BEGIN
tempstr_ := tempstr_ || separator_;
separator_position := INSTR (tempstr_, separator_);
WHILE separator_position <> 0
LOOP
temp := getstringintableform_tempobj (NULL);
temp .col1 := TRIM (SUBSTR (tempstr_, 1, separator_position - 1));
tempstr_ := SUBSTR (tempstr_, separator_position + 1);
separator_position := INSTR (tempstr_, separator_);
tmptab .EXTEND;
tmptab (tmptab.COUNT) := temp;
END LOOP;
RETURN tmptab;
END getstringintableform;
Its in oracle, convert to sqlserver code...
|
|