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!

IF Statement with regular expression?

585992Jul 12 2007 — edited Jul 12 2007
Hi there,
I'd like to write an IF-DStatement that asks if a string begins with H_ or I_. I tried to realize it with a regular expression, but it seems that they can only be used in ther WHERE-Clausel
My trial looks like that:

FOR l IN links LOOP
IF l.destID = REGEXP_LIKE('^H_') THEN type# := 'hidden';
ELSIF l.destID = REGEXP_LIKE('^O_') THEN type# := 'output';
ELSE dbms_output.put_line('Type error ocurring in procedure backprop');
END IF;
END LOOP;

is there another possibility? Kinda l.destID = ('H_'||%) (do not work either)
I could try some other tricks but that would boost my statement...
Thanks for help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2007
Added on Jul 12 2007
5 comments
1,837 views