mikcutu
mikcutu

Reputation: 1092

error when collecting tokens from a full text database

I want to test Oracle's CTX_DOC.TOKENS procedure in order to count the number of occurrence of a string into a document. For this, I have:

create table documents (id number primary key, text bfile);

insert into documents values (1, bfilename('MY_DIR','12things_about_122.pdf'));

create index documents_idx on documents (text) indextype is ctxsys.context;

declare
    the_tokens ctx_doc.token_tab;
begin
    ctx_doc.set_key_type ('PRIMARY_KEY');
    ctx_doc.tokens('documents_idx','1',the_tokens);
    dbms_output.put_line('Number of tokens: '|| the_tokens.count);
 end;

When I test this, the PLSQL part fails with:

Error report:

ORA-20000: Oracle Text error:

DRG-10001: can not access result table the_tokens

ORA-06512: at "CTXSYS.DRUE", line 160

ORA-06512: at "CTXSYS.CTX_DOC", line 862 ORA-06512: at line 5

  1. 00000 - "%s"

*Cause: The stored procedure 'raise_application_error' was called which causes this error to be generated.

*Action: Correct the problem as described in the error message or contact the application administrator or DBA for more information.

Can you help me to understand what is needed much more in order to work correctly, please?

Thank you,

Upvotes: 0

Views: 243

Answers (1)

mikcutu
mikcutu

Reputation: 1092

it seems that the answer was too easy to be seen from the 1st time:

It was necessary to referenciate the ctx_doc.token_tab; with schema name, too.

Instead of the_tokens ctx_doc.token_tab, I had to do the_tokens ctxsys.ctx_doc.token_tab;

Upvotes: 0

Related Questions