I have a string which has some values concatenated. Like val1val2val3val4.
I have a query like
select * from table where var1 = val1 and var2 = val2 and var3 = var3;
val1 and val2 are length only 4 but val3 may differ in length. val4 is of length 8 and no use.
I can form query with functions like var1 = substring (text, 1, 4), var2 = substring (text, 5, 8) and for var3 = substring (text, 9, Len(text) - 8).
But the problem is, I have to manually edit replace the value in 3 places in query each time in workbench. Which is a painful task in my case. Is it possible to just put the string in one place and make the SQL automatically take substrings and use in where clause conditions? I have only read access, cannot modify tables. Local variables like @var = Text, throws error code 1046. Hands tied for me. Need ideas if feasible.