Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Search within an attribute section

GB_CHUVFeb 25 2020 — edited Jun 30 2020

Hi folks,

I can't figure how to to search for text within a specific section.

Here is my XML:

<section id="Salutation" caption="En-tête et salutations">

   <paragraph id="Salutation" phlitemid="Salutation">

          <p>Faxmed de sortie Le patient susnomm&#233; a s&#233;journ&#233; dans notre service</p>

    </paragraph>

</section>

<section id="Anamnese_Faxmed" caption="Anamnèse">

   <paragraph id="TexteLibre" phlitemid="TexteLibre"/>

   <paragraph id="CHUV_AsmtPg_Entree_20170628 16:51:00"

              phlitemid="CHUV_AsmtPg_Entree">Anamnèse à  l'entrée

</paragraph>

</section>

Here is my INDEX CREATION script

[START]

-- PREFERENCES SETTING

EXEC CTX_DDL.DROP_PREFERENCE('LETTER_DS')

    -- PARAMETER: DATASTORE

    EXEC CTX_DDL.CREATE_PREFERENCE('LETTER_DS', 'DIRECT_DATASTORE')

    -- PARAMETER: SECTIONER

    EXEC CTX_DDL.DROP_SECTION_GROUP('LETTRE_SECGRP')

  

    EXEC CTX_DDL.CREATE_SECTION_GROUP('LETTRE_SECGRP', 'AUTO_SECTION_GROUP')

    -- PARAMETER: LEXER

    EXEC CTX_DDL.DROP_PREFERENCE('LETTRE_LXR')

    exec CTX_DDL.CREATE_PREFERENCE('LETTRE_LXR', 'BASIC_LEXER')

        -- ATTRIBUTE: LEXER

        exec CTX_DDL.SET_ATTRIBUTE('LETTRE_LXR', 'PRINTJOINS', '_')

  

-- CREATE INDEX

CREATE INDEX myIndex on myTable(myCLOBCOLUMN)

INDEXTYPE is ctxsys.context

PARAMETERS ('

datastore       LETTER_DS

section group   LETTRE_SECGRP

lexer           LETTRE_LXR

memory          1g

')

parallel 16;

[END]

I'm trying to ping every record that has the word 'susnommé' within the section having id="Salutation"

AUTO_SECTION_GROUP does the job as it even creates in the I$ table the following attribute sections (token type = 5):

  • PARAGRAPH@ID
  • PARAGRAPH@PHLITEMID
  • SECTION@CAPTION
  • SECTION@ID

Here are the QUERIES I have done so far

  1. SELECT * FROM myTable WHERE CONTAINS(myCLOBCOLUMN,'susnommé')>0; --> A record is returned
  2. SELECT * FROM GBE_TEST_LETTRE_XSLT WHERE CONTAINS(TEXT,'susnommé WITHIN SALUTATION')>0; --> No record is returned (even if SALUTATION appers in the I$ table with token type = 4
  3. SELECT * FROM GBE_TEST_LETTRE_XSLT WHERE CONTAINS(TEXT,'SALUTATION WITHIN SECTION@ID AND anamnèse')>0; --> A record is returned while anamnèse is not in the SALUTATION section

Any help would be greatly appreciated

This post has been answered by GB_CHUV on Jun 30 2020
Jump to Answer

Comments

Gary Graham-Oracle

I have not tested specifically on Linux, but it should behave the same as on Windows.  Basically...

0.  You must have a Java 8 JRE (public, standalone) or JDK installed.

1.  If PATH environment variable points to an Oracle client, SQLcl should automatically connect with OCI/Thick driver

2.  If not, then SQLcl connects with Thin driver.

Once connected, you can verify the connection type by running...

show connection

which will display something like...

CONNECTION

HR@jdbc:oracle:oci8:@ADC122PB

or...

CONNECTION:

HR@jdbc:oracle:thin:@(DESCRIPTION =    (ADDRESS_LIST =      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mycompany.com)(PORT = 1521))    )    (CONNECT_DATA =

   (SERVICE_NAME = orcl.mycompany.com)    )  )

If it does not work on Linux as I describe above, then you can try passing the -oci flag when invoking SQLcl.

1 - 1

Post Details

Added on Feb 25 2020
2 comments
207 views