I have a field in database which is in the below format
What SQL function i should use to extract only <string2> from the above field.
I tried using SUBSTR but faced an error called string subscript out of bounds . Let me mention you the syntax i used
Just few days back someone had similar problem.
example: select regexp_substr('P2|10000677|L','[^|]+',1,2) val ;
what's your TD release?
For this task there's a STRTOK function In TD14 (which is a bit easier to use than a regular expression or INSTR):
STRTOK(col, '|', 2)
If you're on a previous release you might talk to your DBA to install one of the Ebay UDFs:
eListGetValByIdx(col, '|', 2)