I need to split a string based on a key in PL/SQL
.
strCode:=empcode:empname:empcontactno;
strval:=101:John:9345723;
I have to write a generic function to split the strval
based on the strCode
and populate separate variables such var_empcode
, var_empname
,var_empcontactno
for a bunch of records.
Split based on the delimiter is simple enough, but split based on key and populating corresponding variables is tricky, because the strCode
is configurable and the function has to be generic to accomodate future changes in the strCode
.
Kindly let me know if there is an easy way to work this one out. Thanks.