Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, ALBERTO.

Asked: August 05, 2006 - 2:18 pm UTC

Last updated: October 09, 2006 - 9:26 pm UTC

Version: 9.1.0.7

Viewed 1000+ times

You Asked

Good morning

I asked you a question in this week about CTX_DOC Package(filter) using blob insteace of clob.

But I found ctx_doc.policy_filter that generates a plain text or HTML version of a document, without requiring an index.

I'd like to know if you can give me and example of how to use ctx_doc.policy_filter with a sample?

Thank you again

Alberto Rico



and Tom said...

this is pretty easy - here is an example using a word document, one that I published here:
</code> http://asktom.oracle.com/Misc/gripe-sheet.html <code>


ops$tkyte%ORA10GR2> exec ctx_ddl.create_policy( 'my_policy', 'ctxsys.inso_filter' );

PL/SQL procedure successfully completed.

ops$tkyte%ORA10GR2> create or replace directory MY_DIR as '/home/tkyte'
2 /

Directory created.

ops$tkyte%ORA10GR2> declare
2 l_bfile bfile;
3 l_clob clob;
4 begin
5 l_bfile := bfilename( 'MY_DIR', 'A_gripe_sheet.doc' );
6 dbms_lob.fileopen( l_bfile );
7 ctx_doc.policy_filter( 'my_policy', l_bfile, l_clob, true );
8 dbms_output.put_line( l_clob );
9 end;
10 /





A gripe sheet . Supposedly true ?gripes by pilots and the responses by
ground crew?. If they are true ? they show the ground crew has a really good
sense of humor. My top favorite on that page (it was really hard to choose):


Problem logged: Friction locks cause throttle levers to stick.
Solution
described: That's what they're there for.

I liked that most of all because
it is somewhat similar to some answers I?ve given in the past myself. ?It is
supposed to do that?.

It was either that one or the ?cannot reproduce on
ground? answer.






PL/SQL procedure successfully completed.


Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thank's TOM

Ihab, October 09, 2006 - 4:40 pm UTC

Thank's MR. Tom For ur time..

I am Developing a new application ,that i have to store a Ms Word documments in a filed in my database, so
do u think that this example can help me ??? or there is another way to do this???

I tried to use the ORASYS.doc intermedia package but i could not display my data ("MS word docommunt in my table")
,so can u please tell me the true way to do it "save my ms Word documments in the database and dispaly the data "


Thank's again MR. TOM
Ihab

Tom Kyte
October 09, 2006 - 9:22 pm UTC

a client "displays" word documents, the database won't.

Yes, you can use blobs to store word documents (heck, I do on asktom, just click on the files tab for example). However a client displays them, not the database.

I forget

Ihab, October 09, 2006 - 5:30 pm UTC

MR. Tom
i forget to tell you that my MS Word documments stores Arabic Languges.


Tank's
Ihab

Tom Kyte
October 09, 2006 - 9:26 pm UTC

no big deal, MS word documents are just binary bits and bytes.

Thank's Mr. Tom

Ihab, October 19, 2006 - 6:58 am UTC

Dear Mr. Tom,

I am sorry for my new question about how to display Ms word documment, because you have answerd it before.....

At present time i am reading the answers which you interduced and i found my answers at this link :-

</code> http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:232814159006 <code>

Thank you for your gracious answers

thanks
ihab.

How to make use of mail_filter with policy filter

Ranjan, August 10, 2007 - 6:31 pm UTC

We are having an application where emails are stored in Blob in the database.As part of a new requirement we need to retrieve set of keywords using getotkens/getthemes from those email content.Can we make use of policy filter here.

Oracle text also provide a filter MAIL_FILTER which getrid of all standard email headers to provide meaningful contents.
So my question here would be if the blob data are email content how effectively we can design a context index to retrieve keywords via gethtmeme/gettoken api. Do we need to take care of charset and language apart from using mail_filter here.Also can both policy and mail filter be useid in conjuction.
Could you please provide an example in your trade mark style.I am confusing with how to design the application here.

More to Explore

CLOB/BLOB/etc

Complete documentation on Securefiles and Large Objects here