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!

regexp_replace to get update a pattren

User_UQDX2Oct 9 2020 — edited Oct 10 2020

SQL> create table test_table (status varchar2(2000)) ;
Table created.
SQL> insert into test_table values ('NODE1:NOT_STARTED,NODE2:NOT_STARTED,NODE3:NOT_STARTED,') ;
1 row created.

SQL> commit;
Commit complete.

SQL> select * from test_table ;
STATUS
--------------------------------------------------------------------------------
NODE1:NOT_STARTED,NODE2:NOT_STARTED,NODE3:NOT_STARTED,

I need to update the NODEn (i.e NODE1, NODE2, NODE3) status based on the given node name.
Ex: if user passed NODE1 then i need to update the status of NODE1 to COMPLETED from NOT_STARTED.

Expected result:
NODE1:COMPLETED,NODE-2:NOT_STARTED,NODE-3:NOT_STARTED

status will be always between the 'NODEn:' and the immediate comma ','

Thanks for your help.

Comments
Post Details
Added on Oct 9 2020
12 comments
633 views