So first a direct answer to the question:
Oracle directly supports extracting a substring matching a regular expression (https://docs.oracle.com/cd/B19306_01/B14251_01/adfns_regexp.htm), so I would do something like this
SELECT REGEX_REPLACE(
REGEX_SUBSTR(ab.URL, 'utm_source=[^&]*'),
'utm_source=',
'') as UTM_SOURCE,--repeat for each sub-field
FROM AB ab
WHERE ab.id = 1;
This will work... but its going to result in some truly awful SQL. Not only that, but if you ever have to migrate away from Oracle (which my company is doing), this will probably have to be rewritten.
Instead, if the option is available, I would definitely do the string parsing on the front end. In code, you can do something like:
Map<String, String> urlParams = new HashMap<String, String>();
if (url.contains("?"))
{
List<String> paramClauses = url.split("?")[1];
for(String clause : paramClauses)
{
urlParams.put(clause.split("=")[0], clause.split("=")[1]);
}
}
return urlParams;
Alternately, you might need to do actual relational logic with the params. If that is the case, I would parse them out into separate columns (so one for each of utm_source, utm_medium, utm_content, etc). This moves over into a data architecture question that's out of scope for this venue... but if what you actually need from this data is the url params, this gets super close to the discussion here Is storing a delimited list in a database column really that bad?