SECTION GROUP trouble!!!

I have Oracle 8.1.6 with Russian language.
I've created my own section group based on BASIC_SECTION_GROUP with following sections:
DESCRIPTION (type zone)
TITLE (type zone)
PID (type zone)
For example, I write XML as CLOB:
<PRODUCT><DESCRIPTION>cool book</DESCRIPTION><TITLE>book</TITLE><PID>bg12</PID></PRODUCT>
When I search, for example, 'book' WITHIN DESCRIPTION, it's allright. But when I'm trying to search it WHITHIN TITLE, I have no results.
Search is allright only in first section.
Have anybody any idea?

I have Oracle 8.1.6 with Russian language.
I've created my own section group based on BASIC_SECTION_GROUP with following sections:
DESCRIPTION (type zone)
TITLE (type zone)
PID (type zone)
For example, I write XML as CLOB:
<PRODUCT><DESCRIPTION>cool book</DESCRIPTION><TITLE>book</TITLE><PID>bg12</PID></PRODUCT>
When I search, for example, 'book' WITHIN DESCRIPTION, it's allright. But when I'm trying to search it WHITHIN TITLE, I have no results.
Search is allright only in first section.
Have anybody any idea?

Similar Messages

  • Problem in creating xml section group

    I have created xml section group with some sections defined in the field.Now my attributes are repeated with different root nodes.so i have put braces for differentiation and created context index.
    drop index abc_indexes_idx;
    begin
    ctx_ddl.remove_section('xyz_xml_group','abLName');
    ctx_ddl.remove_section('xyz_xml_group','abFName');
    ctx_ddl.remove_section('xyz_xml_group','cdLName');
    ctx_ddl.remove_section('xyz_xml_group','cdFName');
    ctx_ddl.remove_section('xyz_xml_group','efLName');
    ctx_ddl.remove_section('xyz_xml_group','efFName');
    ctx_ddl.remove_section('xyz_xml_group','ghLName');
    ctx_ddl.remove_section('xyz_xml_group','ghFName');
    end;
    begin
    ctx_ddl.drop_section_group('xyz_xml_group');
    end;
    begin
    ctx_ddl.drop_preference('xyz_wildcard_pref1');
    end;
    begin
    ctx_ddl.drop_preference('xyz_lexer_pref1');
    end;
    begin
    ctx_ddl.drop_preference('STEM_FUZZY_PREF');
    end;
    begin
    ctx_ddl.create_section_group('xyz_xml_group','XML_SECTION_GROUP');
    ctx_ddl.add_field_section('xyz_xml_group','abLName','IncidentSubject(PersonGivenName');
    ctx_ddl.add_field_section('xyz_xml_group','abFName','IncidentSubject(PersonSurName');
    ctx_ddl.add_field_section('xyz_xml_group','cdLName','ActivityVictim(PersonGivenName');
    ctx_ddl.add_field_section('xyz_xml_group','cdFName','ActivityVictim(PersonSurName');
    ctx_ddl.add_field_section('xyz_xml_group','efLName','ActivityComplainantPerson(PersonGivenName');
    ctx_ddl.add_field_section('xyz_xml_group','efFName','ActivityComplainantPerson(PersonSurName');
    ctx_ddl.add_field_section('xyz_xml_group','ghLName','ActivityWitness(PersonGivenName');
    ctx_ddl.add_field_section('xyz_xml_group','ghFName','ActivityWitness(PersonSurName');
    end;
    begin
    ctx_ddl.create_preference('STEM_FUZZY_PREF','BASIC_WORDLIST');
    ctx_ddl.set_attribute('STEM_FUZZY_PREF','SUBSTRING_INDEX','TRUE');
    end;
    begin
    ctx_ddl.set_attribute('STEM_FUZZY_PREF','PREFIX_INDEX','YES');
    end;
    begin
    ctx_ddl.create_preference('njdex_lexer_pref1','BASIC_LEXER');
    ctx_ddl.set_attribute('STEM_FUZZY_PREF','WILDCARD_MAXTERMS','15000');
    end;
    drop index xyz_indexes_idx
    create index xyz_indexes_idx on xyz_INDEXES(abc column) indextype is ctxsys.context parameters
    ('datastore ctxsys.direct_datastore wordlist STEM_FUZZY_PREF FILTER ctxsys.null_filter lexer xyz_lexer_pref1
    sync(on commit)SECTION GROUP xyz_xml_group MEMORY 500M ');
    My XML document is as follows whichi stored in a column of abc and it is of xmltype datatype
    <?xml version="1.0" encoding="utf-8"?>
    <ab:IncidentReportGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:j="http://www.it.ojp.gov/jxdm/3.0.3" xmlns:ext="http://xml.abc.com/jxdm/3.0.3/extension" xmlns:ab="http://xml.abc.com/jxdm/3.0.3">
    <ab:IncidentReport>
    <ext:IncidentSubject>
    <j:PersonName>
    <j:PersonGivenName>abc</j:PersonGivenName>
    <j:PersonMiddleName />
    <j:PersonSurName>xyz</j:PersonSurName>
    <j:PersonSuffixName />
    <j:PersonFullName>abc, xyz </j:PersonFullName>
    </j:PersonName>
    </ext:IncidentSubject>
    <ext:ActivityComplainantPerson>
    <j:PersonName>
    <j:PersonGivenName>abc</j:PersonGivenName>
    <j:PersonMiddleName />
    <j:PersonSurName>xyz</j:PersonSurName>
    <j:PersonSuffixName />
    <j:PersonFullName>abc, xyz </j:PersonFullName>
    </j:PersonName>
    </ext:ActivityComplainantPerson>
    <ext:ActivityWitness>
    <j:PersonName>
    <j:PersonGivenName>abc</j:PersonGivenName>
    <j:PersonMiddleName />
    <j:PersonSurName>xyz</j:PersonSurName>
    <j:PersonSuffixName />
    <j:PersonFullName>abc, xyz </j:PersonFullName>
    </j:PersonName>
    </ext:ActivityWitness>
    <ext:ActivityVictim>
    <j:PersonName>
    <j:PersonGivenName>abc</j:PersonGivenName>
    <j:PersonMiddleName />
    <j:PersonSurName>xyz</j:PersonSurName>
    <j:PersonSuffixName />
    <j:PersonFullName>abc, xyz </j:PersonFullName>
    </j:PersonName>
    </ext:ActivityVictim>
    <ext:ActivityWitness>
    </ab:IncidentReport>
    </ab:IncidentReportGroup>
    now when i am trying to run the query
    select * from xyz_indexes where contains(xyzcolumn,'(LORI WITHIN abLName)
    & ("BELAND" WITHIN abFName)')>0
    It is not returning anything.
    Can anyone provide me some help on it.

    I changed your data to match what you were searching for, then I noticed that your third parameters for add_field_section were wrong, so I changed that. The query then returns rows, as demonstrated below. However, I suspect that add_field_section is not what you want to use with your XML data since you have tags with the same names within different categories.
    SCOTT@orcl_11g> SET DEFINE OFF
    SCOTT@orcl_11g> begin
      2    ctx_ddl.drop_section_group('xyz_xml_group');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.drop_preference('xyz_lexer_pref1');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.drop_preference('STEM_FUZZY_PREF');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.create_section_group('xyz_xml_group','XML_SECTION_GROUP');
      3    ctx_ddl.add_field_section('xyz_xml_group','abLName','j:PersonGivenName');
      4    ctx_ddl.add_field_section('xyz_xml_group','abFName','j:PersonSurName');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.create_preference('STEM_FUZZY_PREF','BASIC_WORDLIST');
      3    ctx_ddl.set_attribute('STEM_FUZZY_PREF','SUBSTRING_INDEX','TRUE');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.set_attribute('STEM_FUZZY_PREF','PREFIX_INDEX','YES');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.create_preference('xyz_lexer_pref1','BASIC_LEXER');
      3    ctx_ddl.set_attribute('STEM_FUZZY_PREF','WILDCARD_MAXTERMS','15000');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> drop index xyz_indexes_idx
      2  /
    Index dropped.
    SCOTT@orcl_11g> DROP TABLE xyz_indexes
      2  /
    Table dropped.
    SCOTT@orcl_11g> CREATE TABLE xyz_indexes
      2    (xyzcolumn  XMLTYPE)
      3  /
    Table created.
    SCOTT@orcl_11g> INSERT INTO xyz_indexes VALUES
      2  (XMLTYPE (
      3  '<?xml version="1.0" encoding="utf-8"?>
      4  <ab:IncidentReportGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:j="http://www.it.ojp.gov/jxdm/3.0.3" xmlns:ext="http://xml.abc.com/jxdm/3.0.3/extension" xmlns:ab="http://xml.abc.com/jxdm/3.0.3">
      5    <ab:IncidentReport>
      6        <ext:IncidentSubject>
      7          <j:PersonName>
      8            <j:PersonGivenName>LORI</j:PersonGivenName>
      9            <j:PersonMiddleName />
    10            <j:PersonSurName>"BELAND"</j:PersonSurName>
    11            <j:PersonSuffixName />
    12            <j:PersonFullName>abc, xyz </j:PersonFullName>
    13          </j:PersonName>
    14        </ext:IncidentSubject>
    15        <ext:ActivityComplainantPerson>
    16          <j:PersonName>
    17            <j:PersonGivenName>abc</j:PersonGivenName>
    18            <j:PersonMiddleName />
    19            <j:PersonSurName>xyz</j:PersonSurName>
    20            <j:PersonSuffixName />
    21            <j:PersonFullName>abc, xyz </j:PersonFullName>
    22          </j:PersonName>
    23        </ext:ActivityComplainantPerson>
    24        <ext:ActivityWitness>
    25          <j:PersonName>
    26            <j:PersonGivenName>abc</j:PersonGivenName>
    27            <j:PersonMiddleName />
    28            <j:PersonSurName>xyz</j:PersonSurName>
    29            <j:PersonSuffixName />
    30            <j:PersonFullName>abc, xyz </j:PersonFullName>
    31          </j:PersonName>
    32        </ext:ActivityWitness>
    33        <ext:ActivityVictim>
    34          <j:PersonName>
    35            <j:PersonGivenName>abc</j:PersonGivenName>
    36            <j:PersonMiddleName />
    37            <j:PersonSurName>xyz</j:PersonSurName>
    38            <j:PersonSuffixName />
    39            <j:PersonFullName>abc, xyz </j:PersonFullName>
    40          </j:PersonName>
    41        </ext:ActivityVictim>
    42    </ab:IncidentReport>
    43  </ab:IncidentReportGroup>'
    44  ))
    45  /
    1 row created.
    SCOTT@orcl_11g> create index xyz_indexes_idx on xyz_INDEXES(xyzcolumn) indextype is ctxsys.context parameters
      2  ('datastore ctxsys.direct_datastore wordlist STEM_FUZZY_PREF FILTER ctxsys.null_filter lexer xyz_lexer_pref1
      3  sync(on commit)SECTION GROUP xyz_xml_group MEMORY 500M ')
      4  /
    Index created.
    SCOTT@orcl_11g> select * from xyz_indexes where contains(xyzcolumn,'(LORI WITHIN abLName)
      2  & ("BELAND" WITHIN abFName)')>0
      3  /
    XYZCOLUMN
    <?xml version="1.0" encoding="utf-8"?>
    <ab:IncidentReportGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xm
    lns:j="http://www.it.ojp.gov/jxdm/3.0.3" xmlns:ext="http://xml.abc.com/jxdm/3.0.
    3/extension" xmlns:ab="http://xml.abc.com/jxdm/3.0.3">
      <ab:IncidentReport>
        <ext:IncidentSubject>
          <j:PersonName>
            <j:PersonGivenName>LORI</j:PersonGivenName>
            <j:PersonMiddleName />
            <j:PersonSurName>"BELAND"</j:PersonSurName>
            <j:PersonSuffixName />
            <j:PersonFullName>abc, xyz </j:PersonFullName>
          </j:PersonName>
        </ext:IncidentSubject>
        <ext:ActivityComplainantPerson>
          <j:PersonName>
            <j:PersonGivenName>abc</j:PersonGivenName>
            <j:PersonMiddleName />
            <j:PersonSurName>xyz</j:PersonSurName>
            <j:PersonSuffixName />
            <j:PersonFullName>abc, xyz </j:PersonFullName>
          </j:PersonName>
        </ext:ActivityComplainantPerson>
        <ext:ActivityWitness>
          <j:PersonName>
            <j:PersonGivenName>abc</j:PersonGivenName>
            <j:PersonMiddleName />
            <j:PersonSurName>xyz</j:PersonSurName>
            <j:PersonSuffixName />
            <j:PersonFullName>abc, xyz </j:PersonFullName>
          </j:PersonName>
        </ext:ActivityWitness>
        <ext:ActivityVictim>
          <j:PersonName>
            <j:PersonGivenName>abc</j:PersonGivenName>
            <j:PersonMiddleName />
            <j:PersonSurName>xyz</j:PersonSurName>
            <j:PersonSuffixName />
            <j:PersonFullName>abc, xyz </j:PersonFullName>
          </j:PersonName>
        </ext:ActivityVictim>
      </ab:IncidentReport>
    </ab:IncidentReportGroup>
    SCOTT@orcl_11g>

  • Determining Where Hits Were Found (XML Section Groups)

    Hello all,
    Hoping for a bit of help. It's my first time posting here, but I've benefitted from reading a lot of your posts. I have created a single Oracle Text index for a resume database of sorts. It utilizes a user datastore. The procedure I use gathers a a single user's information in my database and organizes it via XML tags that are assigned in the procedure - outputs a CLOB. I did this in order to try the AUTO SECTION GROUP option when indexing, so that I could use the WITHIN operator.
    So, for example, the procedure is given the rowid for a single employee, and the output may be:
    <ALL>
    <PERSONAL>
    83019
    John Smith
    10/05/1973
    Baltimore, MD
    </PERSONAL>
    <SKILLS>
    Oracle Database Administrator
    .NET Developer
    </SKILLS>
    </ALL>
    My problem is I wish to know the SPECIFIC section groups where hits were registered if I search all of the XML
    SELECT EMPLOYEE_ID
    FROM EMPLOYEE_TBL
    WHERE CONTAINS (DUMMY_COLUMN, 'developer WITHIN ALL', 1) > 0
    ORDER BY SCORE (1) DESC
    My output is:
    EMPLOYEE_ID
    83019
    Is there any way I can also list the sections where hits were registered for this user? In this example, I'd want the "SKILLS" section to show up in the result set.

    skMed,
    Yes, that is a problem. Alternatives are the first method using UNION ALL or creating a MATERIALIZED VIEW and indexing that, similar to what I demonstrated to the other poster on this thread, or CTX_DOC.HIGHLIGHT as Roger said. I have provided a demonstration of the problem below, followed by an alternative solution that uses CTX_DOC.HIGHLIGHT as Roger suggested. I used a function but Roger may have a more elegant method.
    SCOTT@orcl_11g> CREATE TABLE employee_tbl
      2    (employee_id  NUMBER,
      3       fname          VARCHAR2 (7),
      4       lname          VARCHAR2 (7),
      5       dob          DATE,
      6       city          VARCHAR2 (9),
      7       state          VARCHAR2 (2),
      8       dummy_column VARCHAR2 (1),
      9       CONSTRAINT emp_id_pk PRIMARY KEY (employee_id))
    10  /
    Table created.
    SCOTT@orcl_11g> CREATE TABLE skills
      2    (employee_id  NUMBER,
      3       skill          VARCHAR2 (30),
      4       CONSTRAINT skills_id_fk FOREIGN KEY (employee_id) REFERENCES employee_tbl (employee_id))
      5  /
    Table created.
    SCOTT@orcl_11g> CREATE TABLE jobs
      2    (employee_id  NUMBER,
      3       job          VARCHAR2 (30),
      4       CONSTRAINT job_id_fk FOREIGN KEY (employee_id) REFERENCES employee_tbl (employee_id))
      5  /
    Table created.
    SCOTT@orcl_11g> BEGIN
      2    INSERT INTO employee_tbl VALUES
      3        (1, 'Adam', NULL, NULL, NULL, NULL, NULL);
      4    INSERT INTO employee_tbl VALUES
      5        (2, 'Bob', NULL, NULL, NULL, NULL, NULL);
      6    INSERT INTO employee_tbl VALUES
      7        (3, 'Charles', NULL, NULL, NULL, NULL, NULL);
      8    INSERT INTO employee_tbl VALUES
      9        (4, 'David', NULL, NULL, NULL, NULL, NULL);
    10    INSERT INTO skills VALUES (1, 'OTHERS');
    11    INSERT INTO skills VALUES (2, '.NET');
    12    INSERT INTO skills VALUES (3, 'OTHERS');
    13    INSERT INTO skills VALUES (4, '.NET');
    14    INSERT INTO jobs   VALUES (1, '.NET');
    15    INSERT INTO jobs   VALUES (2, 'OTHERS');
    16    INSERT INTO jobs   VALUES (3, '.NET');
    17    INSERT INTO jobs   VALUES (4, '.NET');
    18  END;
    19  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> CREATE OR REPLACE PROCEDURE resume
      2    (p_rowid IN     ROWID,
      3       p_clob     IN OUT CLOB)
      4  AS
      5  BEGIN
      6    FOR e IN
      7        (SELECT employee_id,
      8             employee_id || ' ' || fname || ' ' || lname || ' ' || dob || ' '
      9             || city || ',     ' || state AS personal
    10         FROM      employee_tbl
    11         WHERE  ROWID = p_rowid)
    12    LOOP
    13        DBMS_LOB.WRITEAPPEND (p_clob, 10, '<PERSONAL>');
    14        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (e.personal), e.personal);
    15        DBMS_LOB.WRITEAPPEND (p_clob, 11, '</PERSONAL>');
    16        DBMS_LOB.WRITEAPPEND (p_clob, 8, '<SKILLS>');
    17        FOR s IN (SELECT skill FROM skills WHERE employee_id = e.employee_id) LOOP
    18          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (s.skill) + 1, s.skill || ' ');
    19        END LOOP;
    20        DBMS_LOB.WRITEAPPEND (p_clob, 9, '</SKILLS>');
    21        DBMS_LOB.WRITEAPPEND (p_clob, 12, '<JOBHISTORY>');
    22        FOR j IN (SELECT job FROM jobs WHERE employee_id = e.employee_id) LOOP
    23          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (j.job) + 1, j.job || ' ');
    24        END LOOP;
    25        DBMS_LOB.WRITEAPPEND (p_clob, 13, '</JOBHISTORY>');
    26    END LOOP;
    27  END resume;
    28  /
    Procedure created.
    SCOTT@orcl_11g> SHOW ERRORS
    No errors.
    SCOTT@orcl_11g> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('your_datastore', 'USER_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE ('your_datastore', 'PROCEDURE', 'resume');
      4    CTX_DDL.CREATE_SECTION_GROUP ('your_sec_group', 'XML_SECTION_GROUP');
      5    CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'PERSONAL', '<PERSONAL>', TRUE);
      6    CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'SKILLS', '<SKILLS>', TRUE);
      7    CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'JOBHISTORY', '<JOBHISTORY>', TRUE);
      8  END;
      9  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> CREATE INDEX resume_idx ON employee_tbl (dummy_column)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS
      4    ('DATASTORE     your_datastore
      5        SECTION GROUP     your_sec_group
      6        STOPLIST     CTXSYS.EMPTY_STOPLIST')
      7  /
    Index created.
    SCOTT@orcl_11g> CREATE OR REPLACE FUNCTION list_element
      2    (p_string     VARCHAR2,
      3       p_element    INTEGER,
      4       p_separator  VARCHAR2 DEFAULT ':')
      5    RETURN          VARCHAR2
      6  AS
      7    v_string      VARCHAR2 (32767);
      8  BEGIN
      9    v_string := p_separator || p_string || p_separator;
    10    v_string := SUBSTR (v_string, INSTR (v_string, p_separator, 1, p_element) + LENGTH (p_separator));
    11    RETURN SUBSTR (v_string, 1, INSTR (v_string, p_separator) - 1);
    12  END list_element;
    13  /
    Function created.
    SCOTT@orcl_11g> SELECT * FROM employee_tbl ORDER BY employee_id
      2  /
    EMPLOYEE_ID FNAME   LNAME   DOB       CITY      ST D
              1 Adam
              2 Bob
              3 Charles
              4 David
    SCOTT@orcl_11g> SELECT * FROM skills ORDER BY employee_id
      2  /
    EMPLOYEE_ID SKILL
              1 OTHERS
              2 .NET
              3 OTHERS
              4 .NET
    SCOTT@orcl_11g> SELECT * FROM jobs ORDER BY employee_id
      2  /
    EMPLOYEE_ID JOB
              1 .NET
              2 OTHERS
              3 .NET
              4 .NET
    SCOTT@orcl_11g> COLUMN ixv_value    FORMAT A26
    SCOTT@orcl_11g> COLUMN from_section FORMAT A15
    SCOTT@orcl_11g> SELECT ixv_value,
      2           list_element (ixv_value, 1) AS from_section,
      3           TO_NUMBER (list_element (ixv_value, 3)) AS token_type
      4  FROM   ctx_user_index_values
      5  WHERE  ixv_index_name = 'RESUME_IDX'
      6  AND    ixv_class = 'SECTION_GROUP'
      7  /
    IXV_VALUE                  FROM_SECTION     TOKEN_TYPE
    SKILLS:SKILLS:17:Y         SKILLS                   17
    PERSONAL:PERSONAL:16:Y     PERSONAL                 16
    JOBHISTORY:JOBHISTORY:18:Y JOBHISTORY               18
    SCOTT@orcl_11g> COLUMN token_info FORMAT A30 WORD_WRAPPED
    SCOTT@orcl_11g> SELECT token_text, token_type, token_first, token_last, token_count
      2  FROM   dr$resume_idx$i
      3  WHERE  token_text = 'NET'
      4  /
    TOKEN_TEXT       TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    NET                       0           1          4           4
    NET                      17           2          4           2
    NET                      18           1          4           3
    SCOTT@orcl_11g> -- problem:
    SCOTT@orcl_11g> SELECT t.employee_id, t.fname,
      2           SCORE (1),
      3           list_element (v.ixv_value, 1) AS from_section
      4  FROM   employee_tbl t, dr$resume_idx$i i, dr$resume_idx$k k, ctx_user_index_values v
      5  WHERE  CONTAINS (t.dummy_column, '.NET%', 1) > 0
      6  AND    i.token_text = 'NET'
      7  AND    i.token_type = TO_NUMBER (list_element (v.ixv_value, 3))
      8  AND    k.docid BETWEEN i.token_first AND i.token_last
      9  AND    k.textkey = t.ROWID
    10  ORDER  BY t.employee_id
    11  /
    EMPLOYEE_ID FNAME     SCORE(1) FROM_SECTION
              1 Adam             3 JOBHISTORY
              2 Bob              3 JOBHISTORY
              2 Bob              3 SKILLS
              3 Charles          3 SKILLS
              3 Charles          3 JOBHISTORY
              4 David            6 JOBHISTORY
              4 David            6 SKILLS
    7 rows selected.
    SCOTT@orcl_11g> -- alternative solution:
    SCOTT@orcl_11g> CREATE OR REPLACE FUNCTION from_section
      2    (p_emp_id IN VARCHAR2,
      3       p_text      IN VARCHAR2,
      4       p_rowid  IN ROWID)
      5    RETURN VARCHAR2
      6  AS
      7       hightab   ctx_doc.highlight_tab;
      8       v_clob       CLOB;
      9       v_clob2   CLOB;
    10       v_section VARCHAR2 (32767);
    11       v_result  VARCHAR2 (32767);
    12  BEGIN
    13    CTX_DOC.HIGHLIGHT ('resume_idx', p_emp_id, p_text, hightab, FALSE);
    14    DBMS_LOB.CREATETEMPORARY (v_clob, TRUE);
    15    DBMS_LOB.CREATETEMPORARY (v_clob2, TRUE);
    16    resume (p_rowid, v_clob);
    17    FOR i IN 1 .. hightab.COUNT LOOP
    18        v_clob2 := SUBSTR (v_clob, 1, hightab(i).offset);
    19        v_clob2 := SUBSTR (v_clob2, 1, INSTR (v_clob2, '>', -1) - 1);
    20        v_section := SUBSTR (v_clob2, INSTR (v_clob2, '<', -1) + 1);
    21        v_result := v_result || ',' || v_section;
    22    END LOOP;
    23    DBMS_LOB.FREETEMPORARY (v_clob);
    24    DBMS_LOB.FREETEMPORARY (v_clob2);
    25    RETURN LTRIM (v_result, ',');
    26  END from_section;
    27  /
    Function created.
    SCOTT@orcl_11g> SHOW ERRORS
    No errors.
    SCOTT@orcl_11g> COLUMN from_section FORMAT A60 WORD_WRAPPED
    SCOTT@orcl_11g> SELECT t.employee_id, t.fname, SCORE (1),
      2           from_section (employee_id, '.NET%', ROWID) AS from_section
      3  FROM   employee_tbl t
      4  WHERE  CONTAINS (t.dummy_column, '.NET%', 1) > 0
      5  ORDER  BY t.employee_id
      6  /
    EMPLOYEE_ID FNAME     SCORE(1) FROM_SECTION
              1 Adam             3 JOBHISTORY
              2 Bob              3 SKILLS
              3 Charles          3 JOBHISTORY
              4 David            6 SKILLS,JOBHISTORY
    SCOTT@orcl_11g>

  • Limitations of Path Section Group Indexing with alphabet I

    Hi,
    I created oracle text context indexing with Path section group and was trying to retrieve an element using the below query but it was not giving me any output
    select /*+FIRST_ROWS*/rowid,abccolumn,xyz column, efgcolumn,
    from xyz table
    where contains(xyzcolumn, 'I INPATH (/a:xyz/b:abc/c:efg/d:hij)',1)>0 )
    but with the same query instead of I if i am replacing with O i am getting the output.
    I wanted to know the significance of I as i was to retrieve all the other columns based on the search criteria .
    There are only 2 elements I or O in that node.
    with O i am able to retrieve so wanted to know how i can retrieve with I

    begin
    ctx_ddl.drop_section_group('xyz_path_group');
    end;
    begin
    ctx_ddl.drop_preference('xyz_wildcard_pref1');
    end;
    begin
    ctx_ddl.drop_preference('xyz_word_PREF');
    end;
    begin
    ctx_ddl.drop_preference('xyz_lexer_PREF1');
    end;
    begin
    ctx_ddl.create_section_group('xyz_path_group','PATH_SECTION_GROUP');
    end;
    begin
    ctx_ddl.create_preference('xyz_word_PREF','BASIC_WORDLIST');
    ctx_ddl.set_attribute('xyz_word_PREF','SUBSTRING_INDEX','TRUE');
    ctx_ddl.set_attribute('xyz_word_PREF','PREFIX_INDEX','YES');
    end;
    begin
    ctx_ddl.create_preference('xyz_lexer_pref1','BASIC_LEXER');
    ctx_ddl.set_attribute('xyz_word_PREF','WILDCARD_MAXTERMS','15000');
    end;
    drop index xyz;
    create index xyz on abc(pqr) indextype is ctxsys.context parameters
    ('datastore ctxsys.direct_datastore wordlist xyz_word_PREF FILTER ctxsys.null_filter lexer xyz_lexer_pref1
    sync(on commit)SECTION GROUP xyz_path_group MEMORY 500M ');
    This is how i created index and the table i have several column but the column pqr i am indexing has XML (Large) xml with 15 namespaces and with 3 prefixes

  • Does anyone know how to copy a entire section grouped as one?

    Post Author: naughtyjungle
    CA Forum: General
    What i basically want to do is this? I have a report created. Within this report i want to create a new section.  So i will have section A then B.  So section A will be my original report that was created previously.  What i want to do is take all the parameters from section A and duplicate it to section B grouped together.  This is to avoid the tedious copy and paste then rearranging them through size and positioning.Basically want to copy A to B within the same report and do it grouped together so B is identical in size and position to A.  Then i can make necessary changes to B. Any Help/Ideas on this?????????Much appreciated

    Post Author: naughtyjungle
    CA Forum: General
    No I am still stuck on the issue.This is a image of  the same style of the design i createdhttp://i153.photobucket.com/albums/s225/naughtyjungle/CystalReport.jpgWhat i want to do is double that whole section. So there will be a section A and section B and they will look identical and have same positioning, etc.Right now what im doing is using my dual monitor and going through each field and manually entering the size and positioning.  I want a shortcut to skip all that and just a basic group copy and paste??????? Thank you S.T

  • Auto section group/stop section

    Does stop section stops the indexing of the content between stop section tag of XML?
    Is there a way to stop intermedia to index a xml tag? Not just does to display like seting the visibility to false, but ignore the text between a xml tag.
    null

    I'm not sure why your stop sections aren't working, but if you know the layout of the document I would recoomend using explcitly-defined field sections rather than auto_section_group.
    This will be a lot more efficient for querying.
    It will still index the data outside of the <NAME> section, though as part of the "default" section. If you don't want to index that, you could use a user_datastore to remove all the stuff apart from what you want to index.
    - Roger

  • XML Section Group(INPATH)

    I have the below 2 xml files. When i am trying to query using inpath the pattern matches for both xmls and so pulls the data from both the xml's but i want to grab the data from xml1 which is Exact matching data.
    The query pulls the data even if it finds single match from all xml files not the exact match .
    So, can anyone provide the solution for this would be really appreciated.
    XML 01:
    <A>
    <B>
    <C>value0</C>
    <D>value1</D>
    </B>
    </A>
    XML 02:
    <A>
    <B>
    <C>value0</C>
    </B>
    <B>
    <D>value1</D>
    </B>
    </A>
    contains(xml_doc, 'value0 INPATH (//B/C)) & value0 INPATH (//B/C))' > 0

    Sorry,
    I posted the wrong sample xml.Please check the correct xml's below:
    XML 01:
    <A>
    <B>
    <C>value0</C>
    <D>value1</D>
    </B>
    </A>
    XML 02:
    <A>
    <B>
    <C>value0</C>
    </B>
    <B>
    <D>value1</D>
    </B>
    </A>
    contains(xml_doc, 'value0 INPATH (//B/C)) & value0 INPATH (//B/C))' > 0

  • 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');

  • Double sided printing, adding blank page after two different groups

    Post Author: adepper
    CA Forum: General
    I have created a report that is structured as such:
    Group 1 - Based on formula, groups by type
    Group 2 - Based on formula, groups by use
    Group 3 - use (pulled directly from Database)
    Group 4 - ID
    I have the report printing an extra page after group 3.  I used this formula in the Section Expert - New Page After
    remainder(pagenumber,2)=0
    I also use that formula to reset the page number
    What I would like to do is print a second blank page if group 2 does not start on the top of the page, meaning I do not want either group 3 or group 2 to start on the back of a page, so that this report can be placed in a binder, with dividers.
    I have group 3 giving me a blank page with no issues, it is just group 2.
    Any help and/or suggestions would be appreciated.  If I did not give enough details, I am sorry.
    Thanks!

    Post Author: adepper
    CA Forum: General
    After a lot of blood, sweat and tears, not to mention a lot of curse words directed at the computer, I was able to get this to work.  Now I just have to do it for three groupings instead of two (deliver the impossible to your bosses, and they turn around and move the brass ring right out of reach again!)
    In case anyone is interested in how I was able to manage this (I found many sites where people asked this question, but not one complete answer), this is what I did:
    In the footer section:
    Group 4 - ID (database field)
    Group 3 - PrimeUse (database field)
        3a - Contains data
        3b - Contains data
        3c - New Page After, Keep Together, and Reset Page Number After are all checked.  In the condition for Reset Page Number After I also have this formula:
        remainder(pagenumber,2)=0
        3d - New Page After, Keep Together, and Reset Page Number After are all checked.  In the condition for New Page After I have this formula:
        remainder(pagenumber,2)=0
    Group 2 - Suppressed
    Group 1 - Grouped by Store Type -
        1a - Suppressed, New Page After and Keep Together are all checked.
        1b - New Page After and Keep Together are checked.  In the condition for New Page After I have to following formula:
        remainder(totalpagecount,2)=1
    If anyone sees any errors, or if you think you can get it so that I get another page blank, after Group 1, if the Group starts on an even numbered page, I would appreciate the help.
    Thanks!

  • How to search for documents that do not contain a word in a section?

    For example: (deleted% within folder) finds all documents that have deleted in the folder
    I want to find all documents that do not contain "deleted%" within folder.

    If you have other criteria, then you can use "other criteria NOT deleted% within folder". However, if there is no other criteria, then you cannot just begin with NOT, so you have to use "% NOT deleted% within folder", but on a large data set that will result in an error about the wildcard expanding to too many terms.
    SCOTT@orcl_11g> create table test_tab
      2    (id     number,
      3       folder     varchar2(30),
      4       col2     varchar2(15),
      5       dummy     varchar2(1))
      6  /
    Table created.
    SCOTT@orcl_11g> insert all
      2  into test_tab values (1, 'something deleted', 'something', null)
      3  into test_tab values (2, 'whatever', 'deleted', null)
      4  into test_tab values (3, 'something', 'whatever', null)
      5  select * from dual
      6  /
    3 rows created.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.create_preference ('test_datastore', 'multi_column_datastore');
      3    ctx_ddl.set_attribute ('test_datastore', 'columns', 'folder, col2');
      4    ctx_ddl.create_section_group ('test_group', 'basic_section_group');
      5    ctx_ddl.add_field_section ('test_group', 'folder', 'folder', true);
      6    ctx_ddl.add_field_section ('test_group', 'col2', 'col2', true);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> create index test_idx
      2  on test_tab (dummy)
      3  indextype is ctxsys.context
      4  parameters
      5    ('datastore     test_datastore
      6        section group     test_group')
      7  /
    Index created.
    SCOTT@orcl_11g> select * from test_tab
      2  where  contains (dummy, 'something NOT deleted% within folder') > 0
      3  /
            ID FOLDER                         COL2            D
             3 something                      whatever
    SCOTT@orcl_11g> select * from test_tab
      2  where  contains (dummy, '% NOT deleted% within folder') > 0
      3  /
            ID FOLDER                         COL2            D
             2 whatever                       deleted
             3 something                      whatever
    SCOTT@orcl_11g>

  • Need help with Group Headings and showing them on drill down.

    Hi all:
    I think this is a simple question and feel that I should already know the answer but for some reason it eludes me.  What I would like to know is the proper way to hide/display group headings and have them show up on drill down BUT not repeat on each group header.
    What I have for grouping is as follows:
    Group Header #1 u2013 Sales Rep
      Group Header #2 u2013 Customer
        Group Header #3 u2013 Product Class
          Group Header #4 u2013 Stock Code
            Details
          Group Footer #4 u2013 summary calculated on this line
        Group Footer #3  u2013 summary calculated on this line
      Group Footer #2 u2013 summary calculated on this line
    Group Footer #1 u2013 summary calculated on this line
    My goal is to have my report show only the lines listed below by default and allow the user to drill down group by group to the details section:
    Group Header #1 u2013 Sales Rep
      Group Footer #2 u2013 summary calculated on this line
    Group Footer #1 u2013 summary calculated on this line
    If anyone could offer any help it would be greatly appreciated!
    Thanks,
    FatMan

    click section expert, then for example of GH3, highlight it, then click on the formula box for suppression, and put in the code....
    Drilldowngrouplevel < 3
    The result will be that this GH3 is suppressed whenever the report is showing GH1 and 2 but not 3.
    In addition to this, you must Hide(Drill-down ok) GH3. This is also done in the section expert.
    Then just do the same for GF3, and for GH4/GF4 make sure you use...
    Drilldowngrouplevel < 4

  • Detail sections not displayed with Crystal Reports 2010 Runtime (SP1 also)

    I have migrated a VB app from RDC 9 to Crystal Reports 2010 and I'm experiencing a very strange issue.
    In a report with 6 nested groups, the detail part is splitted in 7 section, and the whole detail has the "keep together" flag activated. At runtime, some detail sections are not displayed. There is no suppress condition on the detail section. The missed sections are those near bottom of the page. I suppose that when there is no room to print the section on the page and it should go on the next page, Crystal forget to display it.
    I exported the report in Crystal format and reopened with Crystal Reports designer and the missed section are displayed.
    The same report is displayed correctly using RDC 9.
    If I show the group tree and select the missed section group, the section is correctly displayed on a separate preview page.
    I've some screenshot to better demonstrate the problem.
    I hoped SP1 will resolve the issue but unfortunately it didn't.
    Pier Alberto Guidotti

    This issue has been escalated for a fix. tracking number is TE5000325237. For anyone wanting to attach to this thread with a similar issue, please note the behavior as decribed in the TE below. If the description does not match your issue exactly, please create a new thread.
    Description - Steps to Reproduce;
    1) Run the report in the CR 2008 designer - note the second page
    2) Run the report in VS2010 app using CRVS2010 SP1:
    CrystalReportViewer1.ReportSource = <path to report>
    3) Look at page 2 and compare to page 2 from the CR2008 designer (also, see attached compare.jpg file which is a screen shot of both views) - note missing group on page 2
    4) Export to PDF, DO, RTF - same issue
    5) Print to printer using the viewer print button - same issue
    6) Same issue print to printer using code:
    Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
    crReportDocument.Load("C:\Crystal\Test\Forum tests\Alberto missing detail section\Crystal Issue\Distinta di Taglio CR 2010.rpt")
    crReportDocument.PrintToPrinter(1, 1, 1, 2)
            MsgBox("Done")
    7) Same issue print to printer using code:
    Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
    crReportDocument.Load("C:\Crystal\Test\Forum tests\Alberto missing detail section\Crystal Issue\Distinta di Taglio CR 2010.rpt")
    Dim rcd As ISCDReportClientDocument
            rcd = crReportDocument.ReportClientDocument
            rcd.PrintOutputController.PrintReport()
            MsgBox("Done")
    8) Export to RPT file format - view this export in the CR2008 Designer - report looks as it should
    9) Add report to the .NET2010 project. trying to view the repor tin the .NET2010 IDE results in .NET crashing.
    - Ludek

  • SDATA Section with mutiple occurrence in one document

    Hello,
    in a user defined datastore I create the following xml document:
    <name>Huber</name><vname>Astrid</vname><pcb>1006498200</pcb><pcb>8553001101</pcb><pcb>8553002201</pcb>
    begin
    ctx_ddl.create_preference(preference_name=>'name_store',object_name=>'USER_DATASTORE');
    ctx_ddl.set_attribute (preference_name=>'name_store',attribute_name=>'procedure',attribute_value=>'names_proc');
    ctx_ddl.create_section_group ('name_sg', 'basic_section_group');
    ctx_ddl.add_field_section ('name_sg', 'name', 'name');
    ctx_ddl.add_field_section ('name_sg', 'vname', 'vname');
    ctx_ddl.add_sdata_section ('name_sg', 'pcb', 'pcb', 'varchar2');
    end;
    The field PCB is used in an SDATA section. When I query the table I get a result for
    select * from tbl0100person where contains(name1,'huber within name and astrid within vname and sdata (pcb=''8553002201'')')>0;
    but not for the other two values 8553001101 and 1006498200 of pcb. It seems that a SDATA section only uses the last occurrence of pcb in the document.
    Is there another possibility to index all three values of pcb?

    According to:
    http://docs.oracle.com/database/121/CCREF/cddlpkg.htm#CCREF2103
    "SDATA are single-occurrence only. If multiple instances of an SDATA tag are encountered in a single document, then later instances supersede the value set by earlier instances. This means that the last occurrence of an SDATA tag takes effect."
    As a workaround, you could make the pcb another field section, instead of sdata section, as shown below, adapting some code from your other thread.
    SCOTT@orcl12c> CREATE TABLE tbl0100anschrift -- an
      2    (persno    NUMBER,
      3      plz    VARCHAR2(15),
      4      ort    VARCHAR2(15),
      5      str    VARCHAR2(15))
      6  /
    Table created.
    SCOTT@orcl12c> INSERT INTO tbl0100anschrift VALUES (1, '', '', '')
      2  /
    1 row created.
    SCOTT@orcl12c> CREATE TABLE tbl0100person -- pers
      2    (persno    NUMBER,
      3      name1    VARCHAR2(15),
      4      name3    VARCHAR2(15))
      5  /
    Table created.
    SCOTT@orcl12c> INSERT INTO tbl0100person VALUES (1, 'Huber', 'Astrid')
      2  /
    1 row created.
    SCOTT@orcl12c> CREATE TABLE tbl2000pcbperson -- pp
      2    (persno    NUMBER,
      3      pcbid    NUMBER)
      4  /
    Table created.
    SCOTT@orcl12c> INSERT ALL
      2  INTO tbl2000pcbperson VALUES (1, 8553002201)
      3  INTO tbl2000pcbperson VALUES (1, 8553001101)
      4  INTO tbl2000pcbperson VALUES (1, 1006498200)
      5  SELECT * FROM DUAL
      6  /
    3 rows created.
    SCOTT@orcl12c> CREATE OR REPLACE PROCEDURE names_proc (p_rid  IN rowid,p_clob IN OUT nocopy clob) IS
      2  l_adresse VARCHAR2(4000);
      3  l_name VARCHAR2(200);
      4  l_pcbid VARCHAR2(4000);
      5  l_persno VARCHAR2(32);
      6  l_xmlDoc VARCHAR2(8200);
      7  BEGIN
      8  SELECT name,
      9        LISTAGG(pcb,'') WITHIN GROUP(ORDER BY pcb),
    10        LISTAGG(plz,'') WITHIN GROUP(ORDER BY plz) ||
    11        LISTAGG(ort,'') WITHIN GROUP(ORDER BY ort) ||
    12        LISTAGG(str,'') WITHIN GROUP(ORDER BY str)
    13      INTO l_name,l_pcbid,l_adresse
    14      FROM(
    15          SELECT '<name>'||name1||'</name><vname>'||name3||'/vname>' as name,
    16            DECODE( LAG(plz,1,0) OVER (ORDER BY plz),plz,NULL,'<plz>'||plz||'</plz>'  ) AS plz,
    17            DECODE( LAG(ort,1,0) OVER (ORDER BY ort),ort,NULL,'<ort>'||ort||'</ort>'  ) AS ort,
    18            DECODE( LAG(str,1,0) OVER (ORDER BY str),str,NULL,'<str>'||str||'</str>'  ) AS str,
    19            DECODE( LAG(pp.pcbid,1,0) OVER (ORDER BY pp.pcbid),pp.pcbid,NULL,'<pcb>'||pp.pcbid||'</pcb>'  ) AS pcb
    20          FROM tbl0100anschrift an,
    21            tbl0100person pers,
    22            tbl2000pcbperson pp
    23          WHERE pers.persno=an.persno
    24            AND pers.rowid=p_rid
    25            AND pers.persno=pp.persno
    26            AND an.persno=pp.persno
    27          ) adr
    28      WHERE plz || ort || str ||pcb IS NOT NULL
    29  GROUP BY name;
    30    --
    31    l_xmlDoc:=l_name||l_adresse||l_pcbid;
    32    DBMS_LOB.WRITEAPPEND (p_clob,length(l_xmlDoc),l_xmlDoc);
    33  END;
    34  /
    Procedure created.
    SCOTT@orcl12c> SHOW ERRORS
    No errors.
    SCOTT@orcl12c> DECLARE
      2    v_clob  CLOB;
      3  BEGIN
      4    FOR r IN (SELECT ROWID rid FROM tbl0100person) LOOP
      5      DBMS_LOB.CREATETEMPORARY (v_clob, TRUE);
      6      names_proc (r.rid, v_clob);
      7      DBMS_OUTPUT.PUT_LINE (v_clob);
      8      DBMS_LOB.FREETEMPORARY (v_clob);
      9    END LOOP;
    10  END;
    11  /
    <name>Huber</name><vname>Astrid/vname><plz></plz><ort></ort><str></str><pcb>1006
    498200</pcb><pcb>8553001101</pcb><pcb>8553002201</pcb>
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> begin
      2    ctx_ddl.create_preference(preference_name=>'name_store',object_name=>'USER_DATASTORE');
      3    ctx_ddl.set_attribute
      4      (preference_name=>'name_store',
      5        attribute_name=>'procedure',
      6        attribute_value=>'names_proc');
      7    ctx_ddl.create_section_group ('name_sg', 'basic_section_group');
      8    ctx_ddl.add_field_section ('name_sg', 'name', 'name');
      9    ctx_ddl.add_field_section ('name_sg', 'vname', 'vname');
    10    ctx_ddl.add_field_section ('name_sg', 'pcb', 'pcb');
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> CREATE INDEX name_ix1 ON tbl0100person (name1)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS
      4    ('DATASTORE    name_store
      5      SECTION GROUP    name_sg')
      6  /
    Index created.
    SCOTT@orcl12c> SELECT token_text FROM dr$name_ix1$i
      2  /
    TOKEN_TEXT
    1006498200
    8553001101
    8553002201
    ASTRID
    HUBER
    VNAME
    6 rows selected.
    SCOTT@orcl12c> select * from tbl0100person
      2  where  contains
      3            (name1,
      4            'huber within name and astrid within vname and 8553002201 within pcb')>0
      5  /
        PERSNO NAME1          NAME3
            1 Huber          Astrid
    1 row selected.
    SCOTT@orcl12c> select * from tbl0100person
      2  where  contains
      3            (name1,
      4            'huber within name and astrid within vname and 8553001101 within pcb')>0
      5  /
        PERSNO NAME1          NAME3
            1 Huber          Astrid
    1 row selected.
    SCOTT@orcl12c> select * from tbl0100person
      2  where  contains
      3            (name1,
      4            'huber within name and astrid within vname and 1006498200 within pcb')>0
      5  /
        PERSNO NAME1          NAME3
            1 Huber          Astrid
    1 row selected.

  • Update Statement with group by query

    I need to an update statement that updates the records return from this query:
    SELECT
    GROUP,
    SECTION,
    MAX(ASSIGNED_DATE)
    FROM
    ASSIGNMENTS
    GROUP BY GROUP, SECTION
    I need to update all those records and set HISTORY = 1
    I'm not sure how to form the update statement.
    UPDATE ASSIGNMENTS SET HISTORY = 1 WHERE (SELECT
    GROUP,
    SECTION,
    MAX(ASSIGNED_DATE)
    FROM
    ASSIGNMENTS
    GROUP BY GROUP, SECTION) ?
    Edited by: user9179751 on Apr 18, 2011 11:23 AM

    Just doing a select query: (these are the records that were updated when I ran the update statement you posted)
    SELECT * FROM ASSIGNMENS WHERE (GROUP, SECTION, ASSIGNED_DATE) IN (SELECT GROUP,
    SECTION, MAX(ASSIGNED_DATE)FROM ASSIGNMENTS GROUP BY GROUP, SECTION)
    Records:
    GROUP SECTION    ASSIGNED_DATE
    0010        050098       20011108
    0334    000003       19980116
    0505        320000       20000712
    0676        380000       19980914
    0676        067931       20011221
    0801        600500       19910409
    0801    601701       20090903These are the records I want updated:
    Which I would get using:
    SELECT GROUP, SECTION, MAX(ASSIGNED_DATE)FROM ASSIGNMENTS GROUP BY GROUP, SECTION
    GROUP SECTION ASSIGNED_DATE
    0002                  20100519
    0003                  20090724
    0005          
    0007       360000     
    0007                  20040913
    0009                  19970814
    0010       050098     20011108
    0010                  20000926
    0011          I'm assuming it skips over null values?

  • Running Total in Group Header

    Post Author: bahamaER
    CA Forum: Crystal Reports
    Hello, I have been reviewing threads for running totals and would like some assistance on creating a running total for a group with a condition that will display in the group header, the running total should also reset for each group. Is this possible?
    I know that there are some constraints such as the variable being reset to 0 in the header for each group as well as the group records have not been rendered when the header formulas are being assessed. I have been able to accomplish the task of running totals with conditions for groups using a running total field and also 3 separate formulas placed in the group header, detail and footer. The display is only correct in the group footer; my goal is to have the footer formula in the group header.  Any ideas?  I am currently using CR 8.5 but will be upgrading to CR 2008.
    Thankyou

    Hi,
    If you are trying to calculate Total and display it in Group Header for field value placed in Detail, then you will get incorrect/no value for total, as Crystal Reports prints/processes the report line by line and it will not be able to process the Total for field in Detail section in Group Header.
    Its is by Design.
    For a workaround:
    - Insert the same probematic report (Say A.rpt) as a Subreport in Group Header of this report(Say A.rpt).(Say in GroupHeader A1) and link the Main Report to the
    - Insert Section Below (Say GroupHeader A2)
    - Calculate Total in Section Group Header A2)
    This workaround will reduce the Performance of the report as Subreport will be proceed for each Group Value.
    Regards,
    Kiran

Maybe you are looking for

  • DriverManagerXAConnection is not getting closed.Toplink 9.0.4.5 OC4J 10.1.2

    DriverManagerXAConnection is not getting closed. Toplink is acquiring connections from two pools OracleConnectionPooledDataSource and XAConnectionpool. The connection of PooledDatasource is getting released but the DriverManagerXAConnection is not ge

  • ATV Screen Saver, One Photo at a Time ..PLs

    My ATV's screen saver shows my photos in a tiled, many photos at a time format. I would like to show one full screen photo at a time. Just spent many minutes trying to do this and failed I know this can be done, but do not know how. Help please.

  • Material report without SE16

    Dear Experts I need a report for Materials for Finished & Semi Finished where price indicator is V. Please note I do not have the authorization for SE16. Kindly advise . Many thanks in advance. Regards Ayaz

  • No frames visible in Reports 2.5 Layout on Win2000

    Hello: I upgraded my OS to Win2000 and run Reports 2.5. I am unable to see the frames in the layout editor (the reports displayed/worked fine on Win 98). Please help. Thanks Peter

  • BW Bookmarks problem

    Hi All, User able to view the report thorugh the link provided in the SAP favorites, but error popups keep on coming like " Windows cannot found".How to avoid this popups? Any help would be helpfull. regards, Vijay