Create a text index on multiple tables

I have read the same forum questions a thousand times about doing this and the only thing they show examples of is using multiple columns in one table.
Here is what I have:
create table documents_a
(id number,
text blob);
create table documents_b
(id number,
text blob);
create table documents_c
(id number,
text blob);
I want to be able to do a text search over all three tables on the blob column. I can't use the multi_column_datastore because from what I read this can only be used with one table.
I eventually want to be able to bring up a snippet of the text that contains the keywords and a link to the actual document.
How do I build a text index that includes each blob column from each of the three tables?

OK so I created the materialized view
create materialized view alltabs as
select a.id, a.text, b.id, b.text, c.id, c.text
from tablea a, tableb b, tablec c;
and I created the following
ctx_ddl.create_preference(my_multi', "MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute('my_multi','columns','a_document, b_document, c_document');
Then I attempted but I am not sure what column name to put in the pararens?
create index multi_tab on alltabs(????)
indextype is ctxsys.context
parameters('datastore my_multi sync(on commit)');
I saw a dummy column created in most of the internet examples but just exactly what gets created here? I want to create a multi column index so didn't I already tell it which columns up above?

Similar Messages

  • Cannot create text index in partition table on Oracle 10g

    I try to create context index in a table with 15 millions records. The table is divided 5 partitions and each patition has 3 millions records. When I create the context index in the table, the same error always arised. The follow are my work:
    --First create my own lexer
    begin
    ctx_ddl.createperference('my_chinese_lexer','chinese_lexer');
    end;
    --Second create index
    create index idx_part_text3 on tb_test_part(text3)
    indextype is ctxsys.context local (
    partition p1_ix,
    partition p2_ix,
    partition p3_ix ,
    partition p4_ix,
    partition p5_ix)
    parameters('lexer my_chinese_lexer') parallel;
    --error message
    create index idx_part_text3 on tb_test_part(text3)
    Error in 1 line:
    ORA-12801: Parellel Query Server P000 send error signal
    ORA-29855: Error on execute ODCIINDEXCREATE program
    ORA-06510: PL/SQL: User Defined Error
    ORA-06512: In "CTXSYS.DRIDISP", line 244
    ORA-04030: Try to alloc 65548 Bytes (CTX PRM heap,draccbx:message buffer) Out of memory
    ORA-06512: In "CTXSYS.DRIPARX", line 10
    ORA-06512: In "CTXSYS.TEXTINDEXMETHODS", line 359
    ORA-04030: Try to alloc 65548 Bytes (CTX PRM heap,draccbx:message buffer) Out of memory
    ORA-06512: In "CTXSYS.DRUE", line 191
    ORA-06512: In "CTXSYS.DRUE", line 49
    ORA-06512: In "CTXSYS.DRUE", line 24
    ORA-06512: In "CTXSYS.DRUE", line 186
    ORA-06512: In "CTXSYS.DRVDDL", line 682
    ORA-04030: Try to alloc 65548 Bytes (CTX PRM heap,draccbx:message buffer) Out of memory
    ORA-04030: Try to alloc 65548 Bytes (CTX PRM heap,draccbx:message buffer) Out of memory
    ORA-06512: In "CTXSYS.DRUE", line 191
    ORA-06512: In "CTXSYS.DRUE", line 49
    ORA-06512: In "CTXSYS.DRUE", line 24
    ORA-06512: In "CTXSYS.DRVDDL", line 452
    ORA-06510: PL/SQL: User Defined Error
    BTW:
    My oracle 10g run on linux AS3 box with 4xP4 and 6G Mem.
    I set pga_aggregate_target=2200M, and at the beginning of creating index, the max pga alloced is about 1100M, but when one patition finished, the error arised and the max pga alloced suddenly reached 3500M. So in every times, the index status is always like below:
    P1_ix usable
    P2_ix Inprogress
    P3_ix Inprogress
    P4_ix Inprogress
    P5_ix Inprogress
    Thx for any help!

    Try to increase LARGE_POOL_SIZE.
    PGA_AGGREGATE_TARGET is not only parameter that can meddle in parallel execution.
    Looks like parallel execution parameters is not correctly set. Check it all, including PARALLEL_EXECUTION_MESSAGE_SIZE.

  • Error creating a text Index

    When i tried to create a text index on my system (Oracle 8.1.6, RedHat Linux 6.2) i always get the same error:
    create index pkk on teste(maisumteste)indextype is ctxsys.context
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: interMedia Text error:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: ctxsys: cannot open shared object file: No such file or directory
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 54
    ORA-06512: at line 1
    i'm a beginner in intermedia, so right now i'm stalled in this one, please help me.
    Thanks, in advance.
    Tony Cruz

    Raj Kr Pandit wrote:
    where is the issue?The issue is your code is apples and oranges:
    SQL> CREATE TABLE tab_1(aa nvarchar2(50) PRIMARY KEY,bb clob)
      2  /
    Table created.
    SQL> CREATE INDEX xtab_1_bb ON tab_1 (bb) INDEXTYPE IS CTXSYS.CONTEXT
      2  /
    CREATE INDEX xtab_1_bb ON tab_1 (bb) INDEXTYPE IS CTXSYS.CONTEXT
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-10528: primary keys of type NVARCHAR2 are not allowed
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364
    SQL> SY.

  • Search a text in a multiple tables and one table has BLOB column

    Hi,
    I couldn't find a solution/examples for below scenario in oracle text documentation or related forums.
    I need to search a text in a multiple tables,in that one table has blob column which is used to store the documnents(pdf,doc,jpg..etc) and other tables have varchar2 columns,These tables have realation each other.
    Please provide a sample examples for above scenario.
    Thanks in advance..

    Have a look at my blog entry here:
    https://blogs.oracle.com/searchtech/entry/indexing_data_from_multiple_tables
    That describes two methods of achieving what you are looking for.

  • Error When Creating Oracle Text index using Lexer Keyword

    Hi All,
    I am getting following error when i creating oracle text index using lexer & stoplist keyword.
    Pls Help me if any body know.
    Thanks in Advance.
    Error starting at line 1 in command:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
    PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
    PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
    Error at Command Line:1 Column:13
    Error report:
    SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-11000: invalid keyword LEXER
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
    29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
    *Cause:    Failed to successfully execute the ODCIIndexCreate routine.
    *Action:   Check to see if the routine has been coded correctly.
    Regards,
    Jack R.

    Hi,
    it works if you put an extra PARAMETERS clause at the end so the creation looks like:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
    PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
    PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
    PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
    Hope this helps
    Herald ten Dam

  • Create Oracle Text Index from Java via JDBC

    Hi, I have a question relevant to creation of the Text Index in Oracle Text via Java JDBC.
    In Java I create client application and I connect to remote Oracle server. (there is Oracle
    10g Enterprise Edition 10.2.0.3.0 on Debian Linux OS). In Java I create query:
    CREATE INDEX index_name ON source_tab(text) indextype is ctxsys.context
    parameters('datastore ctxsys.file_datastore filter ctxsys.null_filter');
    and I start it by:
    PreparedStatement stmt = db.prepareStatement(query);
    ResultSet rs = stmt.executeQuery();
    There is problem that Text Index is created empty and when I write out error log then:
    DRG-11513: unable to open or write to file "path"
    I have on my computer Oracle XE 10g (Windows XP OS) here this application in Java functions
    without problems. Without problems it´s with that same query in SQLPlus when I connect at
    this remote Oracle server via PuTTY.
    Do you know anybody where could be error? Or at worst case where find I more detailed
    manual about JDBC Oracle mainly possible errors and problems with compatibility?

    Does it work if you don't use "file_datastore"?
    Eg. try the following in sqlplus:
    create table t (text varchar2(2000));
    insert into t values ('hello world');
    create index ti on t(text) indextype is ctxsys.context;
    select * from t where contains (text, 'hello') > 0;
    Then drop the index ti and try the same "create index" through JDBC. Does that work?
    If so, then we have some kind of issue with the file_datastore. I assume you are aware that the file will be read by the SERVER, not from the client?
    So if your database resides on a Linux box, but you are calling from a Java program on a windows PC, the file names in source_tab(text) must be in Linux format, and must refer to files which are available on the Linux server (and readable by the owner of the Oracle database process).
    So /home/me/file.txt might work, but C:\Documents\file.txt will not.

  • Trouble creating Oracle Text index

    Hey all,
    I am having trouble creating an Oracle Text index. I am receiving the following error when I try to sync the index after inserting numerous rows (@170,000). I have also tried to insert the rows and then create the index afterword. See below.
    ORACLE_TEXT>insert into varchar_test_ot select doc from varchar_test;
    171327 rows created.
    Elapsed: 00:06:40.08
    ORACLE_TEXT>exec ctx_ddl.sync_index('VT_TEST_IDX_OT');
    BEGIN ctx_ddl.sync_index('VT_TEST_IDX_OT'); END;
    ERROR at line 1:
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in drekmap (lob write)
    ORA-22990: LOB locators cannot span transactions
    ORA-06512: at "CTXSYS.DRUE", line 157
    ORA-06512: at "CTXSYS.CTX_DDL", line 1328
    ORA-06512: at line 1
    Elapsed: 00:02:09.07

    CREATE TABLE varchar_test
    (doc VARCHAR2(4000)
    CREATE TABLE varchar_test_ot
    (doc VARCHAR2(4000)
    begin
    ctx_ddl.create_preference('storage_pref','BASIC_STORAGE');
    ctx_ddl.set_attribute('storage_pref', 'I_TABLE_CLAUSE',
    'tablespace ot_test_idx_space storage (initial 1M next 1M)');
    ctx_ddl.set_attribute('storage_pref', 'K_TABLE_CLAUSE',
    'tablespace ot_test_idx_space storage (initial 1M next 1M)');
    ctx_ddl.set_attribute('storage_pref', 'R_TABLE_CLAUSE',
    'tablespace ot_test_idx_space storage (initial 1M next 1M)');
    ctx_ddl.set_attribute('storage_pref', 'N_TABLE_CLAUSE',
    'tablespace ot_test_idx_space storage (initial 1M next 1M)');
    ctx_ddl.set_attribute('storage_pref', 'I_INDEX_CLAUSE',
    'tablespace ot_test_idx_space storage (initial 1M next 1M)');
    ctx_ddl.set_attribute('storage_pref', 'P_TABLE_CLAUSE',
    'tablespace ot_test_idx_space storage (initial 1M next 1M)');
    ctx_ddl.create_section_group('auto','AUTO_SECTION_GROUP');
    ctx_ddl.create_preference('mywordlist', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute('mywordlist','SUBSTRING_INDEX', 'YES');
    end;
    CREATE INDEX vt_test_idx_ot
    ON varchar_test_ot(doc)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('datastore ctxsys.default_datastore
    filter ctxsys.null_filter
    wordlist mywordlist
    storage storage_pref
    section group auto
    memory 50M');

  • Re: how to create a temporary index for a table in program

    Hi,
    I execute a report to access table EKBE. The field that is essential is the CPUDT - entry date.
    Now, the EKBE is not index with this field.
    I do not want to create a permanent index which might occupied space. The current read on EKBE is sequential.
    I thought of creating an index in the program and then releases it once the report is out.
    Is there a way to achieve that?

    Hi,
    You can dump the data into one internal table and create index of that internal table like this:
    tables: ekbe.
    data: begin of itab occurs 0,
           cpudt like ekbe-cpudt,
           indx type i,
           end of itab.
    select cpudt up to 10 rows
    from ekbe into table itab.
    loop at itab.
    itab-indx = sy-tabix.
    write:/ itab-cpudt, itab-indx.
    endloop.
    Regards,
    Bhaskar

  • Creating a form that populates multiple tables

    Hi,
    I need to create a registration form which inserts data into multiple tables (USERS (master-table), PHONES, ADDRESSES, EMAILS, etc) at once. I've been looking through the docs and the only way I've found yet is to build the form on a procedure. Other methods have restriction on using maximum of 2 tables.
    What is the best approach for building a form on multiple tables in htmldb?

    Either do it on a procedure, or simply write the insert in Process yourself:declare
      l_new_deptno number;
    begin
      insert into dept(dname)vales(:P1_DNAME) returning deptno into l_new_deptno;
      insert into emp(ename,sal,deptno)
      values (:P1_NAME,:P1_SALARY,l_new_deptno);
    end;Thanks,
    Tyler

  • Help with creating oracle text index on 2 columns with partial html data

    Hi,
    I need to create an oracle text index on 2 columns.
    TITLE - varchar(255) = contains plain text data
    DESCRIPTION - CLOB = contains partial HTML data
    This is what I created.
    begin
    ctx_ddl.create_preference ('Title_Description_Pref', 'MULTI_COLUMN_DATASTORE');
    ctx_ddl.set_attribute('Title_Description_Pref', 'columns', 'TITLE, DESCRIPTION');
    end;
    begin
    ctx_ddl.create_preference ('bid_lexer', 'BASIC_LEXER');
    ctx_ddl.set_attribute('bid_lexer', 'index_stems', 'ENGLISH');
    ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
    end;
    create index Bid_Title_Index on Bid(title) indextype is ctxsys.context parameters ('LEXER bid_lexer sync (every "sysdate+(1/24)")');
    create index Bid_Title_Desc_Index on Bid(description) indextype is ctxsys.context parameters ('LEXER bid_lexer DATASTORE Title_Description_Pref sync (every "sysdate+(1/24)") filter ctxsys.null_filter section group htmgroup');
    The problem is when I do a CONTAINS(description, '$(auction)')>0. I get results where the descriptions have the "auction" word (which is correct). But, the results also returned rows where the search word is inside an IMG tag. e.g. <img src="http://auction.de/120483" alt="Auction Logo"/>.
    What I would like is to exclude rows where the search word is inside HTML tag attributes, results expected are rows having <a>Auction</a> or <p>For Auction</p> ... etc. Basically stripping the html tags and leave the text contents.
    I'd appreciate some input.
    Thanks,
    Amiel

    Hi,
    I need to create an oracle text index on 2 columns.
    TITLE - varchar(255) = contains plain text data
    DESCRIPTION - CLOB = contains partial HTML data
    This is what I created.
    begin
    ctx_ddl.create_preference ('Title_Description_Pref', 'MULTI_COLUMN_DATASTORE');
    ctx_ddl.set_attribute('Title_Description_Pref', 'columns', 'TITLE, DESCRIPTION');
    end;
    begin
    ctx_ddl.create_preference ('bid_lexer', 'BASIC_LEXER');
    ctx_ddl.set_attribute('bid_lexer', 'index_stems', 'ENGLISH');
    ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
    end;
    create index Bid_Title_Index on Bid(title) indextype is ctxsys.context parameters ('LEXER bid_lexer sync (every "sysdate+(1/24)")');
    create index Bid_Title_Desc_Index on Bid(description) indextype is ctxsys.context parameters ('LEXER bid_lexer DATASTORE Title_Description_Pref sync (every "sysdate+(1/24)") filter ctxsys.null_filter section group htmgroup');
    The problem is when I do a CONTAINS(description, '$(auction)')>0. I get results where the descriptions have the "auction" word (which is correct). But, the results also returned rows where the search word is inside an IMG tag. e.g. <img src="http://auction.de/120483" alt="Auction Logo"/>.
    What I would like is to exclude rows where the search word is inside HTML tag attributes, results expected are rows having <a>Auction</a> or <p>For Auction</p> ... etc. Basically stripping the html tags and leave the text contents.
    I'd appreciate some input.
    Thanks,
    Amiel

  • Creating a tree query on multiple tables

    I have been reading the following article:
    http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/gennick_connectby.html#f1
    The diagram 1b that the above links to shows a local government hierrachy structure stored in multiple tables. I am having a little difficulty understanding how you would write a query (using start with connect by syntax) to get the data displayed in a tree format??
    ie: (spaces are being removed so replaced them with --)
    state1
    --county1
    --county2
    ----township1
    ----township2
    --county3
    state2
    state3
    --county3
    --county4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hi, please post a sample data it would help us to further analyze. thanks.
    here is some example that might help
    NODE_DATA                                NODE_PAREN
    CAR                                      TRANSPORT
    PLANE                                    TRANSPORT
    BIKE                                     TRANSPORT
    TRANSPORT
    HONDA                                    CAR
    747-400                                  PLANE
    MAZDA                                    CAR
    FOOD
    FRUIT                                    FOOD
    VEGETABLE                                FOOD
    SPINACH                                  VEGETABLE
    CARROT                                   VEGETABLE
    12 rows selected.
    SQL> select substr(rpad(' ',decode(level,1,0,2,2,4),' ')||node_data,1,20) node_data
      2    from myTreeData
      3  start with node_parent is null
      4  connect by node_parent = prior node_data;
    NODE_DATA
    TRANSPORT
      CAR
        HONDA
        MAZDA
      PLANE
        747-400
      BIKE
    FOOD
      FRUIT
      VEGETABLE
        SPINACH
        CARROT
    12 rows selected.
    SQL>

  • Building index from multiple tables for text search

    Hallo,
    I had a look at how to build a index table to optimize search with Oracle text.
    At the moment we are using a JOIN of tables to search for a text in several fields located in different tables.
    My question is:
    Is it possible to create that index table from several tables?
    If yes, can you point me out to any links or give me an example.
    So far, all the examples I read were about 1 table only.
    Thanks
    Elisabeth

    The following is an extension of the original example. It uses ctx_ddl.sync_index to synchronize the index and shows the changes in one of the index tables and shows that the query finds the newly synchronized data. It also shows how this only happens when the column that the index is on is updated. In this example, the index is on the dummy column. The first update does not update the dummy column, so the ctx_ddl.sync_index command does not synchronize the new data. The second update does update the related dummy column, so ctx_ddl.sync_index does synchronize the new data. Lastly, I showed what happens to one of the index tables when you rebuild the index. Notice the reduction in rows in the index table after the rebuild process. You could also rebuild online or drop and recreate the index.
    SCOTT@10gXE> DROP TABLE addresses
      2  /
    Table dropped.
    SCOTT@10gXE> DROP TABLE customers
      2  /
    Table dropped.
    SCOTT@10gXE> CREATE TABLE customers
      2    (customer_id NUMBER,
      3       first_name  VARCHAR2(15),
      4       last_name   VARCHAR2(15),
      5       dummy         VARCHAR2(1),
      6    CONSTRAINT   customers_pk PRIMARY KEY (customer_id))
      7  /
    Table created.
    SCOTT@10gXE> CREATE TABLE addresses
      2    (customer_id NUMBER,
      3       street         VARCHAR2(15),
      4       city         VARCHAR2(15),
      5       state         VARCHAR2(2),
      6    CONSTRAINT   addresses_fk FOREIGN KEY (customer_id)
      7                REFERENCES customers (customer_id))
      8  /
    Table created.
    SCOTT@10gXE> GRANT SELECT ON customers TO ctxsys
      2  /
    Grant succeeded.
    SCOTT@10gXE> GRANT SELECT ON addresses TO ctxsys
      2  /
    Grant succeeded.
    SCOTT@10gXE> CONNECT CTXSYS/ctxsys_password
    Connected.
    CTXSYS@10gXE>
    CTXSYS@10gXE> CREATE OR REPLACE PROCEDURE concat_cols
      2    (p_rowid IN     ROWID,
      3       p_clob     IN OUT CLOB)
      4  AS
      5    v_clob            CLOB;
      6  BEGIN
      7    FOR c1 IN
      8        (SELECT customer_id, first_name || ' ' || last_name AS data
      9         FROM      scott.customers
    10         WHERE  ROWID = p_rowid)
    11    LOOP
    12        v_clob := v_clob || c1.data;
    13        FOR c2 IN
    14          (SELECT ' ' || street || ' ' || city || ' ' || state AS data
    15           FROM   scott.addresses a
    16           WHERE  a.customer_id = c1.customer_id)
    17        LOOP
    18          v_clob := v_clob || c2.data;
    19        END LOOP;
    20    END LOOP;
    21    p_clob := v_clob;
    22  END concat_cols;
    23  /
    Procedure created.
    CTXSYS@10gXE> SHOW ERRORS
    No errors.
    CTXSYS@10gXE> GRANT EXECUTE ON concat_cols TO scott
      2  /
    Grant succeeded.
    CTXSYS@10gXE> CONNECT scott/tiger
    Connected.
    SCOTT@10gXE>
    SCOTT@10gXE> EXEC CTX_DDL.DROP_PREFERENCE ('concat_cols_datastore')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('concat_cols_datastore', 'USER_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE ('concat_cols_datastore', 'PROCEDURE', 'ctxsys.concat_cols');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX customer_text_idx ON customers (dummy)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS ('datastore concat_cols_datastore')
      4  /
    Index created.
    SCOTT@10gXE> INSERT INTO customers VALUES (1, 'Bob', 'Smith', NULL)
      2  /
    1 row created.
    SCOTT@10gXE> INSERT INTO addresses VALUES (1, 'Noplace', 'Nowhere', 'CA')
      2  /
    1 row created.
    SCOTT@10gXE> INSERT INTO customers VALUES (2, 'Bob', 'Jones', NULL)
      2  /
    1 row created.
    SCOTT@10gXE> INSERT INTO addresses VALUES (2, 'Smith St.', 'Somewhere', 'CA')
      2  /
    1 row created.
    SCOTT@10gXE> EXEC CTX_DDL.SYNC_INDEX ('customer_text_idx')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> COLUMN   token_text FORMAT A30
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    SOMEWHERE                               0           2          2           1
    ST                                      0           2          2           1
    8 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Smith') > 0
      5  /
    FIRST_NAME      LAST_NAME       STREET          CITY
    Bob             Smith           Noplace         Nowhere
    Bob             Jones           Smith St.       Somewhere
    SCOTT@10gXE> -- dummy is not updated, so the index is not synchronized:
    SCOTT@10gXE> UPDATE   addresses
      2  SET      city = 'Anywhere'
      3  WHERE    city = 'Somewhere'
      4  /
    1 row updated.
    SCOTT@10gXE> EXEC CTX_DDL.SYNC_INDEX ('customer_text_idx')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    SOMEWHERE                               0           2          2           1
    ST                                      0           2          2           1
    8 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Anywhere') > 0
      5  /
    no rows selected
    SCOTT@10gXE> -- once dummy is updated, the index is synchronized:
    SCOTT@10gXE> UPDATE   customers
      2  SET      dummy = NULL
      3  WHERE    customer_id = 2
      4  /
    1 row updated.
    SCOTT@10gXE> EXEC CTX_DDL.SYNC_INDEX ('customer_text_idx')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    SOMEWHERE                               0           2          2           1
    ST                                      0           2          2           1
    ANYWHERE                                0           3          3           1
    BOB                                     0           3          3           1
    CA                                      0           3          3           1
    JONES                                   0           3          3           1
    SMITH                                   0           3          3           1
    ST                                      0           3          3           1
    14 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Anywhere') > 0
      5  /
    FIRST_NAME      LAST_NAME       STREET          CITY
    Bob             Jones           Smith St.       Anywhere
    SCOTT@10gXE> -- notice the changes if the index is rebuilt or dropped and recreated,
    SCOTT@10gXE> ALTER INDEX customer_text_idx REBUILD
      2  /
    Index altered.
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    ANYWHERE                                0           2          2           1
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    ST                                      0           2          2           1
    8 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Anywhere') > 0
      5  /
    FIRST_NAME      LAST_NAME       STREET          CITY
    Bob             Jones           Smith St.       Anywhere
    SCOTT@10gXE> 

  • Creating intermedia text index error

    Hello. I tried creating an index using the below command
    create index mydocs_text_index on
    mydocs(thefile) indextype is ctxsys.context;
    However, I received some error message as follows:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: file not found
    DRG-50704: file not found
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 54
    ORA-06512: at line 1
    What do you think is wrong?
    Thank you

    Is the listener up and running?
    Installation
    1.What are the steps to install interMedia Text manually, AFTER installing the code via the
    installer?
    A.
    cd $ORACLE_HOME/ctx/admin
    B. as SYS:
    @dr0csys.sql ctxsys system temp
    where ctxsys is the ctxsys password
    system is the default tablespace for ctxsys
    temp is the temporary tablespace for ctxsys
    C. as CTXSYS:
    @dr0inst.sql
    /oracle/db/dev118/ctx/lib/libctxx8.so
    (on Solaris)
    where /oracle/db/dev118 is $ORACLE_HOME
    D. as CTXSYS:
    @defaults/drdefus.sql
    Note: this is assuming you want U.S. to be your language default, otherwise run the
    corresponding drdef for your language.
    2.What are the steps to install interMedia Text manually, with a Net8 Configuration?
    A. Configure an IPC listener address.
    For example, change:
    LISTENER =
    (ADDRESS_LIST=
    (ADDRESS=
    (PROTOCOL=tcp) (HOST=ap118sun.us.oracle.com) (PORT=1521)
    to:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP) (HOST = ap118sun) (PORT
    =1521))
    This shows the full LISTENER definition in your listener.ora. Note: EXTPROC0 ends in a
    zero.
    B. Add a system identifier (SID) name of PLSExtProc and a program name of EXTPROC in the server's LISTENER.ORA file.
    For example, in the SID_LIST_LISTENER definition, insert:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC = ...
    (SID_DESC =
    (SID_NAME=PLSExtProc)(ORACLE_HOME=/oracle/db/dev118)
    (PROGRAM=extproc)
    C. Add a net service name description entry for EXTPROC0 in the server's tnsnames.ora
    file, using SID rather than SERVICE_NAME in the CONNECT_DATA section.
    For example, add this to the end of tnsnames.ora:
    extproc_connection_data =
    (DESCRIPTION=
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))
    (CONNECT_DATA=
    (SID=PLSExtProc)
    (PRESENTATION = RO)
    This entry should be added exactly as you see it here (do NOT substitute your SID
    anywhere, do NOT change the case of any text). Note: EXTPROC0 ends in a zero, RO
    ends in an Oh
    1.How do I check my interMedia Text installation and setup?
    A.
    lsnrct1status
    should give you the following:
    LSNRCTL for Solaris: Version
    8.1.5.0.0 - Production on 31-MAR-99 18:57:49
    (c) Copyright 1998 Oracle Corporation. All rights reserved.
    Connecting to
    (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Solaris: Version 8.1.5.0.0 - Production
    Start Date 30-MAR-99 15:53:06
    Uptime 1 days 3 hr. 4 min. 42 sec
    Trace Level off
    Security OFF
    SNMP OFF
    Listener Parameter File
    /private7/oracle/oracle_home/network/admin/listener.ora
    Listener Log File
    /private7/oracle/oracle_home/network/log/listener.log
    Services Summary...
    PLSExtProc has 1 service handler(s)
    oco815 has 3 service handler(s)
    The command completed successfully
    The important information to understand here is the service handler for PLSExtProc.
    B. Create a user/table/index/query thus:
    As SYS or SYSTEM:
    create user ctxtest identified by ctxtest ;
    grant connect, resource, ctxapp to ctxtest ;
    Do any other grants, quotas, tablespace etc. for the new user. As CTXTEST:
    create table quick
    quick_id number primary key,
    text varchar(80)
    insert into quick ( quick_id, text )
    values ( 1, 'The cat sat on the mat' );
    insert into quick ( quick_id, text )
    values ( 2, 'The quick brown fox jumped over the lazy dog' );
    commit;
    create index quick_text on quick ( text )
    indextype is ctxsys.context;
    At this point, if your Net8 setup is NOT correct you will get:
    create index quick_text on quick ( text )
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: ConText error:
    DRG-50704: Net8 listener is not running or cannot start external procedures
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "CTXSYS.DRUE", line 122
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 34
    ORA-06512: at line 1
    If everything is OK, you will get:
    Index created.
    Now try some queries:
    SQL> select quick_id from quick where contains(text, 'cat')>0;
    QUICK_ID
    1
    SQL> select quick_id from quick where contains(text, 'fox')>0;
    QUICK_ID
    2
    Congratulations !! You now have a successful interMedia Text V8.1 installation.
    null

  • Create Trigger to Delete from multiple tables

    Hello:
    I'm trying to write a trigger which will allow me to delete from multiple records. I have two tables where the record for the same client_id needs to be deleted.
    Is it possible to do this? I started writing some code and this is what I have so far:
    create or replace trigger app_t1
    before delete on <table1> ?? -
    for each row
    begin
    delete from client where clientid = :new.clientid;
    delete from key where pk = :newclientid;
    end;I'm stuck on the line where I have "before delete on" where I'm supposed to provide a table name. I can only use one table and I need to delete from two.
    This trigger is supposed to be used within APEX. In APEX, fields are designated as :P1_clientid where P1 references page 1 of the application. Yet, :P1_clientid is set to the field clientid in the table.
    So when I write my trigger, I'm not sure how I'm supposed to set my variables.
    Can someone help?
    I'm also going to post this into the APEX forum.
    Thanks.

    It's not clear to me if you are just trying to keep two tables in syn or whether you are trying to achieve something else.
    A couple of points though:
    - In delete database triggers the :new attributes are NULL. You probably mean to use the :old attributes.
    - Is there some relationship between the two tables? If so, setting the foreign key to CASCADE DELETE might do the trick for you.
    - Another option - better than a database trigger in my opinion - is to just code a procedure that deletes from both tables and call that one from APEX.
    Regards,
    Rob.

  • Problem creating Oracle text index

    Hi,
    I am trying to create an index in Oracle 9i using Oracle Text.
    First i gave this grant as SYSDBA:
    "GRANT ALL ON CTX_DDL TO <USERNAME>"
    Then i executed the following :
    EXECUTE CTX_DDL.CREATE_SECTION_GROUP('MYPATHGROUP','PATH_SECTION_GROUP');
    CREATE INDEX SDS_SLIDE_XML_IDX ON SDS_SLIDE_DATA (SLIDE_XML)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('SECTION GROUP MYPATHGROUP');
    but I got the following error :
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in dricon.get_primary_key
    ORA-00980: synonym translation is no longer valid
    ORA-06512: at "CTXSYS.DRUE", line 157
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 186
    Any ideas?
    Rgds
    Vikram.

    Oracle Text will not index the content inside the portlet of the pages. The portlet is treated as a portlet instance item and only the relevant attributes are searched for, like display name of the portlet, etc.

Maybe you are looking for

  • Why can't I see my services?

    I've logged in with my BigPond details Not all BigPond users are automatically registered for My Account access. To complete your registration: Step 1 Select the Add an account button on your My Account overview page Step 2 Review and enter the requi

  • T61 screen goes black

    Hello, when I turn on my T61 the thinkpad logo comes on, then the screen goes black. Then after I eithe rput it to sleep, or close the lid and open it, the screen comes on for like 3 seconds, then goes out again. Anyone know what the problem is?

  • Backward compatibility with iWork '06

    does anyone know if iWork '08, specifically Pages, will open '06 files? if it can't, i don't know that i want to upgrade...i would rather not download the trial version. thanks in advance.

  • Select List not working in report - see demo

    Ok.. I have created a demo on APEX 4.1.1.. & 4.2 and it fails when 10 chars or more are in list, with 103 rows or more http://apex.oracle.com/pls/apex/f?p=13679:1 workspace:nzp username:demo password:demo Dean

  • Problem in opening of database

    hi everybody can anyone solve this during opening of the database the error is ora 03113 end of file comminication channel when i check the alert log file the expressions are in alter file :- Database mount in Exclusive mode complete : alter database