Skip to content
Advertisement

How to parse a string and get the value after “=” character

So I have string that should contains “Object.Name” once in a row , if I see it ,I have to get the value after “=” character. If doesn’t match it anywhere in the string i should move hardcoded value.

Here is example of the string:

I know that I should use case for that but doesn’t know how to proceed the string

Advertisement

Answer

In Oracle, you can use:

Which, for the sample data:

Outputs:

VALUE OBJECT_NAME
Object.Name=ASDD||Product.Name=DSA ASDD
Product.Name=QWE||Object.Name=WSXS WSXS
Storage.Name=12345||Object.Name=WERR||Product.Name=QAZ WERR

db<>fiddle here


Since you changed the tags, in MySQL:

db<>fiddle here

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement