How to reduce code duplication caused by substring and instring?
问题 I need to parse a text field (Description), delimited by '\n', into three separate fields. I am doing this by utilizing substr and instr , but it results in difficult to read and repetitive sql. Is there a way to create and use a variable or expression to hold the "position" value returned by the instring function so I can pass that variable to substr instead? My code posted below functions and returns the correct results, but it doesn't feel right. There's a lot of duplication. Relevant Raw