Re: more Help with Oracle constrant on two tables problem

From: Michael O'Shea <michael.oshea_at_tessella.com>
Date: Tue, 19 Feb 2008 05:45:26 -0800 (PST)
Message-ID: <9a6cb591-01d1-4519-b11d-351c83032ee7@28g2000hsw.googlegroups.com>


On Feb 18, 9:39 pm, jharbo..._at_googlemail.com wrote:
> Hello Mark D Powell, Robert Klemme, Michael O'Shea, David FitzJarrell
> and thank you for your help before.
>
> I have a table called "table1" that has the following in it
>
> id1     checkCount     word
>  1         4                 Oracle
>  2         5                 School
>  6         3                 the
>
> "table2" has the following
>
> id1      Description
>  1       oracle oracle oracle oracle
>  2       oracle school oracle school school school
>  6       the school the party the oracle
>
> I need to make a constrant in oracle so that sentences are added only
> when they contain "checkcount" number of words.
>
> I mean that oracle oracle oracle oracle id=1 is allowed to be added
> (it contains oracle x 4) and not oracle oracle oracle id=1 as it only
> contains oracle x 3.
>
> How can I do this.
>
> Thank you
> Jon

Jon, you can count the number of times a word appears in a "document" using Oracle Text. I have described one approach previously here (watch the wrap).

http://groups.google.co.uk/group/comp.databases.oracle.server/browse_thread/thread/98294b150778ebc8/8ddd9dae8bbcb2d4?hl=en&lnk=st&q=#8ddd9dae8bbcb2d4

Without having to roll your own word count algorithms, this will be the quickest approach.

Once you start reading about Oracle Text, take note that the complete featureset of Oracle Text is not available in XE, your target DBMS.

According to http://www.oracle.com/technology/pub/articles/asplund-textsearch.html, Oracle Text is part of XE
According to http://download-uk.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm, "The Oracle Text English and French Supplied Knowledge Bases are not included in Oracle Database XE. As a result, the following functions are not available: ...."

You can implement the required constraint using the approach demonstrated in a thread kicked off by you within the last few days, link here:

http://groups.google.com/group/comp.databases.oracle.misc/browse_frm/thread/af3408bf2f0759ac/34ec74db9c230c2b#34ec74db9c230c2b

Regards

Mike

TESSELLA Michael.OShea_at_tessella.com

__/__/__/  Tessella Support Services plc
__/__/__/  3 Vineyard Chambers, ABINGDON, OX14 3PX, England
__/__/__/  Tel: (44)(0)1235-555511  Fax: (44)(0)1235-553301
www.tessella.com Registered in England No. 1466429 Received on Tue Feb 19 2008 - 07:45:26 CST

Original text of this message