This discussion is archived
3 Replies Latest reply: Aug 13, 2013 10:49 AM by Barbara Boehmer RSS

oracle text error (DRG-10502);entity extraction;ctx_entity.extract

user7753875 Newbie
Currently Being Moderated

Dear sirs,


I am user of oracle 11g release 2. I am attempting to use the entity extraction feature of oracle text for the first time.

When I execute the following statement via sql developer:



I am getting the following:

ORA-2000: Oracle Text error:

DRG-10502: index POL05 does not exist


Any comments and/or suggestions?


Why is POL05 referred to as an index instead of a policy?





  • 1. Re: oracle text error (DRG-10502);entity extraction;ctx_entity.extract
    Barbara Boehmer Oracle ACE
    Currently Being Moderated

    What do you get if you execute it from SQL*Plus instead of SQL Developer?  Please post a copy and paste of a whole reproducible test case from SQL*Plus.

  • 2. Re: oracle text error (DRG-10502);entity extraction;ctx_entity.extract
    user7753875 Newbie
    Currently Being Moderated

    Please note that Entity Extraction uses some third party technology "under the covers" which is deliberately disabled in If you run these examples in (or when it's out) you will receive a "feature not generally available" message. The functionality can be re-enabled, but only by contacting Oracle Support so they can run some checks on whether your applications will be affected by the replacement of this third party technology in the next major release.

  • 3. Re: oracle text error (DRG-10502);entity extraction;ctx_entity.extract
    Barbara Boehmer Oracle ACE
    Currently Being Moderated

    If you upgrade to Oracle 12c, it works in that version, as shown below.


    SCOTT@orcl12c_11gR2> select banner from v$version

      2  /




    Oracle Database 12c Enterprise Edition Release - 64bit Production

    PL/SQL Release - Production

    CORE    Production

    TNS for 64-bit Windows: Version - Production

    NLSRTL Version - Production


    5 rows selected.


    SCOTT@orcl12c_11gR2> create table docs

      2    (id   number,

      3      txt  clob)

      4  /


    Table created.


    SCOTT@orcl12c_11gR2> insert into docs (id, txt) values (1,

      2  'Sam A. Schwartz retired as executive vice president of Hupplewhite INc. in New York.')

      3  /


    1 row created.


    SCOTT@orcl12c_11gR2> begin

      2    ctx_entity.create_extract_policy ('POL05');

      3  end;

      4  /


    PL/SQL procedure successfully completed.


    SCOTT@orcl12c_11gR2> create table entities

      2    (id      number,

      3      entities    xmltype)

      4  /


    Table created.


    SCOTT@orcl12c_11gR2> declare

      2    my_results   clob;

      3  begin

      4    for r in (select * from docs) loop

      5       ctx_entity.extract ('POL05', r.txt, 'ENGLISH', my_results);

      6       insert into entities (id, entities) values (, xmltype (my_results));

      7    end loop;

      8  end;

      9  /


    PL/SQL procedure successfully completed.


    SCOTT@orcl12c_11gR2> select * from entities order by id

      2  /








      <entity id="0" offset="75" length="8" source="SuppliedDictionary">

        <text>New York</text>



      <entity id="1" offset="27" length="24" source="SuppliedDictionary">

        <text>executive vice president</text>



      <entity id="2" offset="0" length="15" source="SuppliedRule">

        <text>Sam A. Schwartz</text>



      <entity id="3" offset="75" length="8" source="SuppliedDictionary">

        <text>New York</text>






    1 row selected.


    SCOTT@orcl12c_11gR2> column type format a30

    SCOTT@orcl12c_11gR2> column text format a30

    SCOTT@orcl12c_11gR2> select, t.type, t.text

      2  from   entities e,

      3          xmltable

      4             ('/entities/entity'

      5          passing e.entities

      6          columns

      7            offset    number    PATH '@offset',

      8            lngth    number    PATH '@length',

      9            text       varchar2(50) PATH 'text/text()',

    10            type       varchar2(50) PATH 'type/text()',

    11            source   varchar2(50) PATH '@source') t

    12  /


            ID TYPE                           TEXT

    ---------- ------------------------------ ------------------------------

             1 city                           New York

             1 person_jobtitle                executive vice president

             1 person_name                    Sam A. Schwartz

             1 state                          New York


    4 rows selected.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points