I need to write a stored procedure for which the input is a string.
The input string contains variable names and their values separated by pipeline delimiter like this:
Name =Praveen | City=Hyderabad | Mobile=48629387429| Role=User| etc
In the stored procedure I have declared variables like @x, @y, @z, @t to obtain values as
@x=Praveen (Name value)
@y=Hyderabad (City Value)
@z=48629387429(Mobile Value)
@t=User(Role Value)
Also input string can have the values in any order like
City=Hyderabad | Mobile=48629387429 | Role=User | Name =Praveen |etc
Once I parse the values into @x, @y, @z, @t etc I have to use these values in the stored procedure.
Kindly let me how I can parse the input string to obtain the values of Name, City, Mobile, Role into @x, @y, @z and @t respectively.
One possible solution is use XML