i want to write a UDF which uses String Value and starting index number and count number like that:
GetValueUDF(“i am 18 years old.”,6,2) output: 18 , 6: .nth starting point, 2: count
GetValueUDF(“i am 101 years old.”,6,3) output: 101
GetValueUDF(“i am 101 years old.”,1,4) output: “i am”
I am not quite sure why you want to create a user defined function for this since that is what the
substringfunction does. But you should be able to use something like the following:See SQL Fiddle with Demo