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!

Getting the exact match from the text

KVBOct 6 2020

Hi All,
I need to extract the object names used from the definition using SQL.
CREATE TABLE V(DEFINITION VARCHAR2(100));
INSERT INTO V VALUES('CREATE OR REPLACE VIEW PRODUCER_V AS SELECT * FROM PRODUCER P LEFT JOIN PROD P1 ON P.ID=P1.ID');
INSERT INTO V VALUES('CREATE OR REPLACE VIEW PRODUCER_FTR_V COMMENT='**' AS SELECT * FROM PRODUCER_V P LEFT JOIN PROD P2 ON P.ID=P1.ID');
COMMIT;

SELECT * FROM V;
I can do a plain select using LIKE operator to find the pattern. Here all i am looking for an exact match and display the matched word if found.I have looked into regular expressions but no luck in finding the exact one.
e.g
1)If i am searching for a word 'PRODUCER' , it's exact match is available in the first row and second row has a partial match which i don't need.
Appreciate if you any pointers.
Thanks
KVB

Comments
Post Details
Added on Oct 6 2020
5 comments
1,206 views