Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wildcard replace function?

user1151048Nov 24 2020 — edited Nov 24 2020

Hello community,
I am trying to find a function that will replace a string with a new value, but I need the entire string replaced, In my case, I want all rows in a column with "uek" in the name to return simply "UEK". I tried REGEXP_REPLACE and other functions but none seem capable of replacing the entire string, just the exact string itself. Am I doing something wrong or do you know of a function that will address this?
e.g.:
regexp_substr(v.UPDATE_LEVEL,'*uek*','UEK') as UEK,
124.39.5.el7uek.x86_64 >>> should be represented as UEK
124.39.5.1.el7uek.x86_64 should be represented as UEK

Ideally, I want to make this into a Yes/No column where rows without UEK are represented as "No", but I'll be happy just to get this working.

Thanks,

John

This post has been answered by Gaz in Oz on Nov 24 2020
Jump to Answer
Comments
Post Details
Added on Nov 24 2020
4 comments
3,439 views