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!

How to use 'Oracle Text' CONTAINS operator to extract numeric values only?

Sam_PAug 10 2017 — edited Aug 16 2017

Hello,

I have a table column of data-type VARCHAR2(4000), which has a CONTEXT index created on. This column contains "free-text" values entered as paragraphs without any pattern to it.

Using the CONTAINS operator, we have been able to filter or narrow down the result-set further, based on certain words to look for to get to our "hit-list". However, within this "hit-list" result-set, in "free-text" column, there could be several occurrences of numeric values within a paragraph in a single cell-value.

Is there a way to use the CONTAINS operator to extract all the numeric values from this column? We have tried to use REGEXP on the result-set to extract all occurrences of numeric values but it is taking a very long time to classify (extract the numeric values into into separate columns). This filtered result-set contains approximately 200K records but the nature of the REGEXP is quite complex because only certain numeric values are actually of interest to us and not all of them. So, our first step is to try to extract all numeric values and dump them into separate columns and then in the next step, we would like to check for the values in these separate columns to pick the one which is of interest.

Any ideas on how to approach this in a performance-efficient manner?

Thanks in advance!

This post has been answered by Paulzip on Aug 11 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2017
Added on Aug 10 2017
24 comments
1,182 views