PLSQ Table Exporter/SHOW SQL made wrong SQL 4 CTX-Indexe

D.Wenzel

Member²
Servus,

i define an intermedia index with the Filter BY feature (from other shema)

Code:
CREATE INDEX  WENZ_CI ON  .... (NAME)
    INDEXTYPE IS "CTXSYS"."CONTEXT"
    FILTER BY ID

i export an table in the PL/SQL Developer Export Format (the other Export a havn't testet yet),
if i import the .PDE File the importert generate a invalid SQL

Code:
create index WENZ_CI on ....  (NAME, ID)
  indextype is CTXSYS.CONTEXT

ORA-29851: Domain-Index kann nur auf einer Spalte generiert werden

the Filter BY column ID ist wrong included in the index-column list

Yours Daniel

Seen in:

Version 14.0.1.1965
Version 13.0.6.1911 (32 bit)
 
Last edited:
The DDL in the SHOW Table/Recreate window is also wrong (in 13 and 14)

create the table

Code:
drop table wenz_muster;

create table wenz_muster
( id     number(15) not null,
  name_1 varchar2(33) not null,
  name_2 varchar2(100) not null
);

alter table wenz_muster
  add constraint wenz_pk primary key (id)
  using index;

create index  wenz_ci on ec_sys.wenz_muster (name_1)
   indextype is ctxsys.context
  filter by id
;

an now i let generate the DDL by pl/sql developer - Press the SHOW SQL Button

Code:
-- Create table
create table WENZ_MUSTER
(
  id     NUMBER(15) not null,
  name_1 VARCHAR2(33) not null,
  name_2 VARCHAR2(100) not null
)
tablespace EC_TBS_SYS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Create/Recreate indexes
create index WENZ_CI on WENZ_MUSTER (NAME_1, ID)
  indextype is CTXSYS.CONTEXT;
-- Create/Recreate primary, unique and foreign key constraints
alter table WENZ_MUSTER
  add constraint WENZ_PK primary key (ID)
  using index
  tablespace EC_TBS_SYS
  pctfree 10
  initrans 2
  maxtrans 255;

i think, the dictionary SQL to get the DOMAIN Indexes DDL is wrong ...

th Get all DDL this must used to get all additional parameters/settings

Code:
select ctx_report.create_index_script(index_name => 'WENZ_CI') from dual;

begin
  ctx_ddl.create_preference('"WENZ_CI_DST"','DIRECT_DATASTORE');
end;
/

begin
  ctx_ddl.create_preference('"WENZ_CI_FIL"','NULL_FILTER');
end;
/

begin
  ctx_ddl.create_section_group('"WENZ_CI_SGP"','NULL_SECTION_GROUP');
  ctx_ddl.add_sdata_column('"WENZ_CI_SGP"','ID','"ID"');
end;
/

begin
  ctx_ddl.create_preference('"WENZ_CI_LEX"','BASIC_LEXER');
  ctx_ddl.set_attribute('"WENZ_CI_LEX"','COMPOSITE','GERMAN');
  ctx_ddl.set_attribute('"WENZ_CI_LEX"','MIXED_CASE','YES');
  ctx_ddl.set_attribute('"WENZ_CI_LEX"','ALTERNATE_SPELLING','GERMAN');
end;
/

begin
  ctx_ddl.create_preference('"WENZ_CI_WDL"','BASIC_WORDLIST');
  ctx_ddl.set_attribute('"WENZ_CI_WDL"','STEMMER','GERMAN');
  ctx_ddl.set_attribute('"WENZ_CI_WDL"','FUZZY_MATCH','GERMAN');
end;
/

begin
  ctx_ddl.create_stoplist('"WENZ_CI_SPL"','BASIC_STOPLIST');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ab');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','aber');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','allein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','als');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','also');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','am');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','an');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','auch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','auf');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','aus');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','außer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','bald');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','bei');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','beim');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','bin');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','bis');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','bißchen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','bist');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','da');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dabei');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dadurch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dafür');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dagegen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dahinter');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','damit');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','danach');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','daneben');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dann');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','daran');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','darauf');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','daraus');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','darin');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','darüber');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','darum');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','darunter');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','das');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','daß');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dasselbe');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','davon');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','davor');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dazu');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dazwischen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','deine');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','deinem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','deinen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','deiner');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','deines');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','demselben');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','den');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','denn');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','der');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','derselben');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','des');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','desselben');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dessen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dich');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','die');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dies');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','diese');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dieselbe');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dieselben');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','diesem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','diesen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dieser');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dieses');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dir');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','doch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','dort');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','du');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ebenso');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ehe');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','eine');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','einem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','einen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','einer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','eines');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','entlang');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','er');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','es');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','etwa');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','etwas');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','euch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','euer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','eure');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','eurem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','euren');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','eurer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','eures');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','für');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','fürs');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ganz');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','gar');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','gegen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','genau');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','gewesen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','her');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','herein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','herum ');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','hin');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','hinter');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','hintern');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ich');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihm');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihn');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihnen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Ihnen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihr');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihre');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Ihre');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihrem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Ihrem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihren');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Ihren');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihrer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Ihrer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ihres');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Ihres');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','im');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','in');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ist');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ja');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','je');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jedesmal');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jedoch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jene');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jenem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jenen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jener');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','jenes');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','kaum');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','kein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','keine');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','keinem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','keinen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','keiner');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','keines');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','man');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','mehr');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','mein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','meine');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','meinem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','meinen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','meiner');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','meines');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','mich');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','mir');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','mit');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nach');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nachdem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nämlich');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','neben');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nicht');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nichts');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','noch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nun');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','nur');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ob');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ober');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','obgleich');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','oder');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','ohne');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','paar');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sehr');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sei');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sein');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seine');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seinem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seinen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seiner');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seines');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seit');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','seitdem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','selbst');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sich');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sie');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','Sie');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sind');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','so');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sogar');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','solch');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','solche');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','solchem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','solchen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','solcher');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','solches');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sondern');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','sonst');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','soviel');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','soweit');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','über');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','um');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','und');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','uns');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','unser');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','unsre');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','unsrem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','unsren');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','unsrer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','unsres');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','vom');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','von');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','vor');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','während');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','war');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wäre');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wären');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','warum');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','was');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wegen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','weil');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','weit');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','welche');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','welchem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','welchen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','welcher');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','welches');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wem');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wenn');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wer');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','weshalb');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wessen');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wie');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wir');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','wo');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','womit');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','zu');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','zum');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','zur');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','zwar');
  ctx_ddl.add_stopword('"WENZ_CI_SPL"','zwischen');
end;
/

begin
  ctx_ddl.create_preference('"WENZ_CI_STO"','BASIC_STORAGE');
  ctx_ddl.set_attribute('"WENZ_CI_STO"','R_TABLE_CLAUSE','lob (data) store as (cache)');
  ctx_ddl.set_attribute('"WENZ_CI_STO"','I_INDEX_CLAUSE','compress 2');
end;
/

begin
  ctx_output.start_log('WENZ_CI_LOG');
end;
/

create index "EC_SYS"."WENZ_CI"
  on "EC_SYS"."WENZ_MUSTER"
      ("NAME_1")
  indextype is ctxsys.context
  filter by
    ""ID""
  parameters('
    datastore       "WENZ_CI_DST"
    filter          "WENZ_CI_FIL"
    section group   "WENZ_CI_SGP"
    lexer           "WENZ_CI_LEX"
    wordlist        "WENZ_CI_WDL"
    stoplist        "WENZ_CI_SPL"
    storage         "WENZ_CI_STO"
  ')
/

begin
  ctx_output.end_log;
end;
/
 
Last edited:
Back
Top