I am running the following in Oracle sql. I am able to obtain the result I want but would like to understand how to apply the alternative. I want to pull out the name which always starts at the 18th character, but the names and characters after are always different.
Example: "Assigned to user John Smith in group 5678"
This is found in table history.description.
If I use SUBSTR (HISTORY.DESCRIPTION, 18, INSTR (HISTORY.DESCRIPTION,' in')-18 AS NAME
I get my desired result of "John Smith"
I am trying SUBSTR (HISTORY.DESCRIPTION,18, REGEXP_SUBSTR (HISTORY.DESCRIPTION, '(\S*)(\w)', ' in')
Ora 01722 invalid number error is what I get.
I am not understanding how to apply this function