Skip to main content
Question

regexp_sustr Logic not working

  • February 21, 2022
  • 1 reply
  • 51 views

Forum|alt.badge.img+3

Hi Team,

 

I want to extract a particular word from a string, I am using “regexp_substr”, but its not giving result as expected.

 

TAB_NAME : Test TABLE IC_X_CUST_HEADER_F_123_TAB A, CUSTOMER_ORDER B, LEFTJOIN (PURHCASE_ORDER_LINE)

 

From above text, I want to extract the word ‘IC_X_CUST_HEADER_F_123_TAB” , so I wrote below logic.

 

SELECT 
regexp_substr(t.tab_name,
'ic_[A-z]+[0-9]+) AS output FROM IC_TAB_LIST t;

 

But, its not giving result.

 

can anyone suggest ?

 

Thanks,

Srini 

 

This topic has been closed for comments

1 reply

Kelum Pradeep Kumara
Superhero (Employee)
Forum|alt.badge.img+18

Hi @TechSriniG 
seems your regexp_substr statement is not a completed one.

Try below

SELECT regexp_substr(t.tab_name,
'IC_[A-z]+[0-9]+_[A-z]+') AS output FROM IC_TAB_LIST t;

I tried as below

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings