Research using fuzzy context in multiple params
Hi, my previous post is about research catserch and the context, I had advice of Roger and Barbara (both are extremely useful ~ thanks), I focus now by using the search from the context, but I had a problem of fuzzy search. I did some research, didnlt get very much, I think that it is a question for the expertise once again, sorry for the trouble and sincerely thank you for your time.------------------------------
Test data
----------------------------
CREATE TABLE cust_catalog
(id NUMBER (16),
First name VARCHAR2 (80).
name VARCHAR2 (80).
Date of birth,
type VARCHAR2 (10)
)
INSERT ALL
INTO cust_catalog VALUES (1, 'John', 'Smith', to_date('10/03/1971','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (2, 'Xavier', 'Johnson', to_date('05/07/1974','DD/MM/YYYY'), 'Female')
INTO cust_catalog VALUES (3, 'David', 'Miles', to_date('16/10/1978','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (4, 'Chris', 'Johnny', to_date('25/02/1976','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (5, 'Jenny', 'The forge', to_date('28/11/1977','DD/MM/YYYY'), 'Female')
INTO cust_catalog VALUES (6, 'Andy', 'Mil', to_date('16/08/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (7, 'Andrew', 'Smithe', to_date('15/12/1974','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (8, 'John', 'Smith', to_date('07/11/1972','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (9, 'William John', "Henson", to_date('04/01/1971','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (10, "Emma John", "Mil", to_date('06/04/1979','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (11, 'Jon', 'Smith', to_date('19/09/1977','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (12, 'Jen', 'Smith', to_date('17/06/1978','DD/MM/YYYY'), 'Female')
INTO cust_catalog VALUES (13, 'Chrissie', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (14, 'Yau', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (15, 'Chrisi', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (16, 'Johnny', 'Clark', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (17, "Bobbie", "Clarkson", to_date('21/05/1975','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (18, 'Bob', 'Clark', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (19, 'Jones', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (20, 'Johan', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
INTO cust_catalog VALUES (21, "Jean", "Smithie", to_date('21/05/1975','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (22, "Chris", "Smithey", to_date('21/05/1975','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (23, "Jean", "The forge", to_date('21/05/1975','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (24, "Chris", "Smithie", to_date('21/05/1975','DD/MM/YYYY'), "Mâle")
INTO cust_catalog VALUES (25, 'John', 'Smithke', to_date('21/05/1975','DD/MM/YYYY'), 'Mâle')
SELECT * FROM DUAL
EXEC CTX_DDL. CREATE_PREFERENCE ("cust_lexer", "BASIC_LEXER");
EXEC CTX_DDL. SET_ATTRIBUTE ("cust_lexer", "SKIPJOINS',", ".) » +-()/');
EXEC CTX_DDL. Create_Preference ("cust_wildcard_pref", "BASIC_WORDLIST");
CTX_DDL.set_attribute EXEC ('cust_wildcard_pref', 'prefix_index', 'YES');
EXEC CTX_DDL. CREATE_PREFERENCE ("forename_datastore", "MULTI_COLUMN_DATASTORE");
EXEC CTX_DDL. SET_ATTRIBUTE ("forename_datastore", "COLUMNS", "FirstName");
EXEC CTX_DDL. CREATE_PREFERENCE ("surname_datastore", "MULTI_COLUMN_DATASTORE");
EXEC CTX_DDL. SET_ATTRIBUTE ('surname_datastore', 'COLUMNS', 'name');
EXEC CTX_DDL. CREATE_SECTION_GROUP ("your_sec", "BASIC_SECTION_GROUP");
EXEC CTX_DDL. ADD_FIELD_SECTION ("your_sec", "first name", "first name", TRUE);
EXEC CTX_DDL. ADD_FIELD_SECTION ('your_sec', 'name', 'name', TRUE);
EXEC CTX_DDL. ADD_FIELD_SECTION ("your_sec", "birth", "date of birth", TRUE);
CREATE INDEX forename_context_idx ON cust_catalog (first name) INDEXTYPE IS CTXSYS. FRAMEWORK
FILTER BY genre
PARAMETERS
("Forename_datastore of the DATA store
SECTION your_sec GROUP
LEXER cust_lexer
List of WORDS cust_wildcard_pref')
CREATE INDEX surname_context_idx ON cust_catalog (family name) INDEXTYPE IS CTXSYS. FRAMEWORK
FILTER BY genre
PARAMETERS
("Surname_datastore of the DATA store
SECTION your_sec GROUP
LEXER cust_lexer
List of WORDS cust_wildcard_pref')
-This work sql ok if not blurred
SELECT * from cust_catalog
WHERE CONTAINS (name, "Jean |") Chris ') > 0 AND CONTAINS (name,'smith |) Miles | MIL ') > 0
-cleaning
DROP TABLE cust_catalog;
EXEC CTX_DDL. DROP_PREFERENCE ("cust_lexer");
EXEC CTX_DDL. DROP_PREFERENCE ("cust_wildcard_pref");
EXEC CTX_DDL. DROP_PREFERENCE ("forename_datastore");
EXEC CTX_DDL. DROP_PREFERENCE ("surname_datastore");
EXEC CTX_DDL. DROP_SECTION_GROUP ("your_sec");
DROP INDEX forename_context_idx;
DROP INDEX surname_context_idx;
-------------------
Questions here
-------------------
1. I have problem when I try to implement fuzzy search
SELECT * from cust_catalog
WHERE CONTAINS (name,' fuzzy ({john | chris}, 1, 100, weight)') > 0
AND CONTAINS (name, ' smith | ") Miles | Milton) > 0
2. am I also like to add on the beach of date of birth in the search, don't know what is the best way to do this, please comment below
SELECT * from cust_catalog
WHERE CONTAINS (name,' fuzzy ({john | chris}, 1, 100, weight)') > 0
AND CONTAINS (name, ' smith | ") Miles | Milton) > 0
AND date of birth BETWEEN TO_DATE('01/02/1970','DD/MM/YYYY') AND TO_DATE('11/07/1980','DD/MM/YYYY')
3. There is a new line night employment insertion in this table, the reference to Roger that I need to create a trigger to update the index, this means to DROP and CREATE indexes for the forename_context_idx and the surname_context_idx every time when night work is running?
Published by: Emily Robertson on November 14, 2012 13:02
For maximum effectiveness, you must use an index and one contains the clause. You should put all your columns of text, such as the first name and family name and sex of your group of multi_column_datastore and the article. You can use the filter by and surlabasedesdonneesdufabricantduballast to add the column to the index. When you query a date using surlabasedesdonneesdufabricantduballast, the date must be in the format yyyy/mm/dd.
You can create index on a column of text. Which column you create the index on must be the column that you are looking for and should be the column that is being updated in order to cause the text Oracle to recognize that there was an update.
Fuzzy cannot be applied to a single term (Word), you will need to use a concatenation and replace to change something like 'fuzzy(word1|word2)' to ' fuzzy (word1) | Fuzzy (word2) ".
In the following example, I used the table, lexer, and list of words you provided. I used a multi_column_datastore with all the columns of text three (surname, name and sex) and put all three of these columns in the section group. I've added a dummy column called any_column and created the index on this column, filtering by date of birth, using the data store, section group, lexer and wordlist, and adding sync (on validation), which will cause the index that you want to synchronize whenever a row is inserted or deleted, or that the index is created on the any_column is updated. Then I inserted the data to show that the synchronization is carried out. I then showed a query using all of the features you requested and explained the plan shows that it uses an index, press to access everything, so it's a very efficient query.
You will still need to optimize or rebuild or delete and recreate periodically to reduce the fragmentation of the index caused by frequent synchronization.
-script:
-- table, lexer, and wordlist you provided:
CREATE TABLE cust_catalog
(id NUMBER (16),
forename VARCHAR2 (80),
surname VARCHAR2 (80),
birthdate DATE,
gender VARCHAR2 (10))
/
EXEC CTX_DDL.CREATE_PREFERENCE ('cust_lexer', 'BASIC_LEXER');
EXEC CTX_DDL.SET_ATTRIBUTE ('cust_lexer', 'SKIPJOINS' , ',''."+-()/');
EXEC CTX_DDL.Create_Preference ('cust_wildcard_pref', 'BASIC_WORDLIST');
EXEC CTX_DDL.set_attribute ('cust_wildcard_pref', 'prefix_index', 'YES');
-- revised datastore, section group, added column, and index:
EXEC CTX_DDL.CREATE_PREFERENCE ('names_and_gender_datastore', 'MULTI_COLUMN_DATASTORE');
EXEC CTX_DDL.SET_ATTRIBUTE ('names_and_gender_datastore', 'COLUMNS', 'forename, surname, gender');
EXEC CTX_DDL.CREATE_SECTION_GROUP ('your_sec', 'BASIC_SECTION_GROUP');
EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'forename', 'forename', TRUE);
EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'surname', 'surname', TRUE);
EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'gender', 'gender', TRUE);
ALTER TABLE cust_catalog ADD (any_column VARCHAR2(1))
/
CREATE INDEX all_columns_context_idx
ON cust_catalog (any_column)
INDEXTYPE IS CTXSYS.CONTEXT
FILTER BY birthdate
PARAMETERS
('DATASTORE names_and_gender_datastore
SECTION GROUP your_sec
LEXER cust_lexer
WORDLIST cust_wildcard_pref
SYNC (ON COMMIT)')
/
-- data you provided:
INSERT ALL
INTO cust_catalog VALUES (1, 'John', 'Smith', to_date('10/03/1971','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (2, 'Emaily', 'Johnson', to_date('05/07/1974','DD/MM/YYYY'), 'Female', null)
INTO cust_catalog VALUES (3, 'David', 'Miles', to_date('16/10/1978','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (4, 'Chris', 'Johnny', to_date('25/02/1976','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (5, 'Jenny', 'Smithy', to_date('28/11/1977','DD/MM/YYYY'), 'Female', null)
INTO cust_catalog VALUES (6, 'Andy', 'Mil', to_date('16/08/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (7, 'Andrew', 'Smithe', to_date('15/12/1974','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (8, 'John', 'Smith', to_date('07/11/1972','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (9, 'Willam John', 'Henson', to_date('04/01/1971','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (10, 'Emma John', 'Mil', to_date('06/04/1979','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (11, 'Jon', 'Smith', to_date('19/09/1977','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (12, 'Jen', 'Smith', to_date('17/06/1978','DD/MM/YYYY'), 'Female', null)
INTO cust_catalog VALUES (13, 'Chrissie','Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (14, 'Chrisy', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (15, 'Chrisi', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (16, 'Johnny', 'Clark', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (17, 'Bobbie', 'Clarkson', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (18, 'Bob', 'Clark', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (19, 'Jone', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (20, 'Johan', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (21, 'John', 'Smithie', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (22, 'Chris', 'Smithey', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (23, 'John', 'Smithy', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (24, 'Chris', 'Smithie', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
INTO cust_catalog VALUES (25, 'John', 'Smithke', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
SELECT * FROM DUAL
/
COMMIT
/
-- query:
COLUMN forename FORMAT A10
COLUMN surname FORMAT A10
SET AUTOTRACE ON EXPLAIN
SELECT * FROM cust_catalog
WHERE CONTAINS
(any_column,
'(FUZZY (' || REPLACE ('john|chris', '|', ', 1, 100, WEIGHT) | FUZZY (')
|| ', 1, 100, WEIGHT) WITHIN forename) AND
(FUZZY (' || REPLACE ('smith|Miles|Mil', '|', ', 1, 100, WEIGHT) | FUZZY (')
|| ', 1, 100, WEIGHT) WITHIN surname) AND
(SDATA (birthdate BETWEEN ''1970/01/02'' AND ''1980/11/07''))') > 0
/
SET AUTOTRACE OFF
-- cleaning
DROP TABLE cust_catalog;
EXEC CTX_DDL.DROP_PREFERENCE ('cust_lexer');
EXEC CTX_DDL.DROP_PREFERENCE ('cust_wildcard_pref');
EXEC CTX_DDL.DROP_PREFERENCE ('names_and_gender_datastore');
EXEC CTX_DDL.DROP_SECTION_GROUP ('your_sec');
-execution:
SCOTT@orcl_11gR2> -- table, lexer, and wordlist you provided:
SCOTT@orcl_11gR2> CREATE TABLE cust_catalog
2 (id NUMBER (16),
3 forename VARCHAR2 (80),
4 surname VARCHAR2 (80),
5 birthdate DATE,
6 gender VARCHAR2 (10))
7 /
Table created.
SCOTT@orcl_11gR2> EXEC CTX_DDL.CREATE_PREFERENCE ('cust_lexer', 'BASIC_LEXER');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.SET_ATTRIBUTE ('cust_lexer', 'SKIPJOINS' , ',''."+-()/');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.Create_Preference ('cust_wildcard_pref', 'BASIC_WORDLIST');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.set_attribute ('cust_wildcard_pref', 'prefix_index', 'YES');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2>
SCOTT@orcl_11gR2> -- revised datastore, section group, added column, and index:
SCOTT@orcl_11gR2> EXEC CTX_DDL.CREATE_PREFERENCE ('names_and_gender_datastore', 'MULTI_COLUMN_DATASTORE');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.SET_ATTRIBUTE ('names_and_gender_datastore', 'COLUMNS', 'forename, surname, gender');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2>
SCOTT@orcl_11gR2> EXEC CTX_DDL.CREATE_SECTION_GROUP ('your_sec', 'BASIC_SECTION_GROUP');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'forename', 'forename', TRUE);
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'surname', 'surname', TRUE);
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'gender', 'gender', TRUE);
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2>
SCOTT@orcl_11gR2> ALTER TABLE cust_catalog ADD (any_column VARCHAR2(1))
2 /
Table altered.
SCOTT@orcl_11gR2> CREATE INDEX all_columns_context_idx
2 ON cust_catalog (any_column)
3 INDEXTYPE IS CTXSYS.CONTEXT
4 FILTER BY birthdate
5 PARAMETERS
6 ('DATASTORE names_and_gender_datastore
7 SECTION GROUP your_sec
8 LEXER cust_lexer
9 WORDLIST cust_wildcard_pref
10 SYNC (ON COMMIT)')
11 /
Index created.
SCOTT@orcl_11gR2> -- data you provided:
SCOTT@orcl_11gR2> INSERT ALL
2 INTO cust_catalog VALUES (1, 'John', 'Smith', to_date('10/03/1971','DD/MM/YYYY'), 'Male', null)
3 INTO cust_catalog VALUES (2, 'Emaily', 'Johnson', to_date('05/07/1974','DD/MM/YYYY'), 'Female', null)
4 INTO cust_catalog VALUES (3, 'David', 'Miles', to_date('16/10/1978','DD/MM/YYYY'), 'Male', null)
5 INTO cust_catalog VALUES (4, 'Chris', 'Johnny', to_date('25/02/1976','DD/MM/YYYY'), 'Male', null)
6 INTO cust_catalog VALUES (5, 'Jenny', 'Smithy', to_date('28/11/1977','DD/MM/YYYY'), 'Female', null)
7 INTO cust_catalog VALUES (6, 'Andy', 'Mil', to_date('16/08/1975','DD/MM/YYYY'), 'Male', null)
8 INTO cust_catalog VALUES (7, 'Andrew', 'Smithe', to_date('15/12/1974','DD/MM/YYYY'), 'Male', null)
9 INTO cust_catalog VALUES (8, 'John', 'Smith', to_date('07/11/1972','DD/MM/YYYY'), 'Male', null)
10 INTO cust_catalog VALUES (9, 'Willam John', 'Henson', to_date('04/01/1971','DD/MM/YYYY'), 'Male', null)
11 INTO cust_catalog VALUES (10, 'Emma John', 'Mil', to_date('06/04/1979','DD/MM/YYYY'), 'Male', null)
12 INTO cust_catalog VALUES (11, 'Jon', 'Smith', to_date('19/09/1977','DD/MM/YYYY'), 'Male', null)
13 INTO cust_catalog VALUES (12, 'Jen', 'Smith', to_date('17/06/1978','DD/MM/YYYY'), 'Female', null)
14 INTO cust_catalog VALUES (13, 'Chrissie','Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
15 INTO cust_catalog VALUES (14, 'Chrisy', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
16 INTO cust_catalog VALUES (15, 'Chrisi', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
17 INTO cust_catalog VALUES (16, 'Johnny', 'Clark', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
18 INTO cust_catalog VALUES (17, 'Bobbie', 'Clarkson', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
19 INTO cust_catalog VALUES (18, 'Bob', 'Clark', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
20 INTO cust_catalog VALUES (19, 'Jone', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
21 INTO cust_catalog VALUES (20, 'Johan', 'Smith', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
22 INTO cust_catalog VALUES (21, 'John', 'Smithie', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
23 INTO cust_catalog VALUES (22, 'Chris', 'Smithey', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
24 INTO cust_catalog VALUES (23, 'John', 'Smithy', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
25 INTO cust_catalog VALUES (24, 'Chris', 'Smithie', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
26 INTO cust_catalog VALUES (25, 'John', 'Smithke', to_date('21/05/1975','DD/MM/YYYY'), 'Male', null)
27 SELECT * FROM DUAL
28 /
25 rows created.
SCOTT@orcl_11gR2> COMMIT
2 /
Commit complete.
SCOTT@orcl_11gR2> -- query:
SCOTT@orcl_11gR2> COLUMN forename FORMAT A10
SCOTT@orcl_11gR2> COLUMN surname FORMAT A10
SCOTT@orcl_11gR2> SET AUTOTRACE ON EXPLAIN
SCOTT@orcl_11gR2> SELECT * FROM cust_catalog
2 WHERE CONTAINS
3 (any_column,
4 '(FUZZY (' || REPLACE ('john|chris', '|', ', 1, 100, WEIGHT) | FUZZY (')
5 || ', 1, 100, WEIGHT) WITHIN forename) AND
6 (FUZZY (' || REPLACE ('smith|Miles|Mil', '|', ', 1, 100, WEIGHT) | FUZZY (')
7 || ', 1, 100, WEIGHT) WITHIN surname) AND
8 (SDATA (birthdate BETWEEN ''1970/01/02'' AND ''1980/11/07''))') > 0
9 /
ID FORENAME SURNAME BIRTHDATE GENDER A
---------- ---------- ---------- --------- ---------- -
1 John Smith 10-MAR-71 Male
8 John Smith 07-NOV-72 Male
10 Emma John Mil 06-APR-79 Male
11 Jon Smith 19-SEP-77 Male
13 Chrissie Smith 21-MAY-75 Male
14 Chrisy Smith 21-MAY-75 Male
15 Chrisi Smith 21-MAY-75 Male
19 Jone Smith 21-MAY-75 Male
20 Johan Smith 21-MAY-75 Male
21 John Smithie 21-MAY-75 Male
22 Chris Smithey 21-MAY-75 Male
23 John Smithy 21-MAY-75 Male
24 Chris Smithie 21-MAY-75 Male
25 John Smithke 21-MAY-75 Male
14 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 1894062579
-------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 127 | 4 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| CUST_CATALOG | 1 | 127 | 4 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | ALL_COLUMNS_CONTEXT_IDX | | | 4 (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("CTXSYS"."CONTAINS"("ANY_COLUMN",'(FUZZY (john, 1, 100, WEIGHT) | FUZZY (chris,
1, 100, WEIGHT) WITHIN forename) AND (FUZZY (smith, 1, 100, WEIGHT) | FUZZY (Miles,
1, 100, WEIGHT) | FUZZY (Mil, 1, 100, WEIGHT) WITHIN surname) AND (SDATA (birthdate
BETWEEN ''1970/01/02'' AND ''1980/11/07''))')>0)
Note
-----
- dynamic sampling used for this statement (level=2)
SCOTT@orcl_11gR2> SET AUTOTRACE OFF
SCOTT@orcl_11gR2> -- cleaning
SCOTT@orcl_11gR2> DROP TABLE cust_catalog;
Table dropped.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('cust_lexer');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('cust_wildcard_pref');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('names_and_gender_datastore');
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_SECTION_GROUP ('your_sec');
PL/SQL procedure successfully completed.
Tags: Database
Similar Questions
-
How can I use a context menu to change values in the numbers?
I would use a context menu to view different values depending on whether you choose.
example: projects
sheet 1: projects, broken down by supplies, each of the deliveries was the price. I currently have this game to show me all the neede resources to complete everything, I want to implement in order to choose a pop up of a building of character, etc. and have it show me how it is necessary for this.
HI Black Jack,
I'm sure that many young people can do what you ask, but I do not understand your table - what data you want to move where and the place where.
What would be in the context menu, where the popup would be and where the data would be displayed.
Quinn
-
I use 4 windows with multiple tabs, but I 'don't know why one of them (window) always close when I restar computer
Hello, by default the firefox session restore feature only allows you to save last 3 windows open. to change this, type on: config in the address bar of firefox (confirmed the message information where it appears) and search for the preference named browser.sessionstore.max_windows_undo. Double-click it and change its value to 4 (or more).
http://KB.mozillazine.org/browser.sessionstore.max_windows_undo
-
Can bookmarks be portable to multiple computers? Is it an option to connect and use my favorites with multiple computers and locations? Thank you
-
How to get the "Run as different user" option using the context Menu
I work with the domain environment and use os win 7 but it do not display "run as user deffrent' so, how get the"Run as a different user"option using the context Menu, share pls burned discription.
(also try pressing shift + right click but nothing else)
Atul Rai
E-mail address is removed from the privacy *.
May be of help to the: http://www.sevenforums.com/tutorials/155532-run-different-user-without-shift-right-click-context-menu.html
-
Can I use my desktop on multiple computers applications?
I just wanted to know exactly how many licenses you are given with each product. Can I use my desktop on multiple computers applications? Or if I'm without one of my computers (i.e. it breaks etc.) can I download my apps on another computer under my plan of creative cloud?
You have 2 allowances of use / connections / activations that may be active. If a computer breaks without being able to log out, you must contact the support so they can reset the counter.
Mylenium
-
Conversion of a delete using the context statement and policies MEV
Hello
I'm trying to convert a delete statement in an update statement using the context and political MEV.
+ / * Assumes that the "user1" user already exists. This is a user of the application * / +.
Conn User1/pwd
create table user1.test_a)
ID number 4,
Description varchar2 (100),
number (1) deleted
+);+
ALTER table user1.test_a add the primary key constraint test_a_pk (id);
insert into user1.test_a (1, 'abc', 0);
insert into user1.test_a (2, 'def', 0);
commit;
I would like to convert each physical deletion a logical removal: instructions such as "delete from user1.test_a where id = 1" must be converted to "day all deleted user1.test_a = 1 where id = 1".»
I found the following way: I create a policy to avoid the physical deletion. In addition, the political function should update the deletion indicator too.
Conn User1/pwd
+ / * Create package context * / +.
create or replace package user1.pkg_security_context is
p_set_ctx of the procedure)
i_test_a_id in % user1.test_a.id type
+);+
end;
+/+
create or replace package body is user1.pkg_security_context
procedure p_set_ctx)
i_test_a_id in % user1.test_a.id type
+) is +.
Start
DBMS_SESSION.set_Context ("user1_ctx", "test_a_id", i_test_a_id);
end;
end;
+/+
display errors
+ / * Create the trigger to put into context before deleting * / +.
create or replace trigger user1.test_a_bef_trg
before you delete the user1.test_a
for each line
declare
pragma autonomous_transaction;
Start
-does not validate the previous update, not deletion that fired the trigger.
commit;
User1.pkg_security_context.p_set_ctx (: old.id);
end;
+/+
display errors
user1_ctx context to create using user1.pkg_security_context;
+ / * Political * / +.
create or replace function user1.f_policy_chk_dels)
object_schema in varchar2,
object_name in varchar2
+) return varchar2 +.
is
out_string varchar2 (400) by default, 1 = 2 ';
+/*+
* out_string is the return value.
*-' WHERE 1 = 2' ' doesn't mean anything for access to.
*/
Start
If (loc_logged_usr_authorized > 0) then
+/*+
* Set the flag removed 1
*/
update of the game user1.test_a deleted = 1 where id = sys_context ('user1_ctx', 'test_a_id');
out_string: = out_string. 'or 1 = 1 ';
end if;
Return out_string.
end;
+/+
display errors
+/*+
Create policies
*/
Start
() dbms_rls.add_policy
object_schema = > 'user1 ',.
object_name = > "test_a"
POLICY_NAME = > "policy_chk_dels"
function_schema = > 'user1',-function scheme
policy_function = > 'f_policy_chk_dels', - function policy
statement_types = > 'DELETE '.
+);+
end;
+/+
When I try to delete a record from the table test_a:
Conn User1/pwd
SQL > delete sim ilogdia.oplsimulaciones where sim.id = 9999;
+ 0 rows deleted.
No row has been deleted, but the update stmt does not work. This means that the 'deleted' flag has not been updated.
Any ideas?
Thank you in advance.
Marco A. Serrano
Published by: albrotar on October 15, 2012 08:42
Published by: albrotar on October 15, 2012 08:42
Published by: albrotar on October 15, 2012 08:43The policy function is applied once per execution of the statement. The political function executes first, and the UPDATE statement updates probably, no line because the context is not yet filled. The level of the line fills the frame (I'm assuming that your session may even see context values populated by autonomous transaction - I guess it's possible, but I have to test this) after the UPDATE statement is already complete. VALIDATION in the row-level trigger is also useless - it does that to changes made by the current transaction that is independent, of which there is none--it cannot apply to changes made in the other autonomous transactions. Declaring the level line trigger to use autonomous transactions does not seem to do anything other than to open the question of whether the values defined under the autonomous transaction are visible in the transactions of the appellant.
Even if, somehow, did not work, the use of transactions autonomous would be a very bad idea because Oracle is free to roll back a partially executed query (and the work done by its triggers) and re - run. Oracle does with some regularity to maintain the consistency of Scripture.
Justin
-
MEV using the context of the Application
I need to set up an EVP by using a context of Appplication but I still have problems despite the use of the Oracle's Web site examples.
That's what I'm doing:
I have 2 tables in the schema of the system. One of them is a table of customers and the other is the supervisors table.
When a supervisor connects, he should be able to read each row in the customer table, which is attributed to him.
The supervisors table has essentially superv_id and client_id;
So, I have a package that retrieves the ID of the supervisor during his connection. But I have'nt not been able to implement a work
Function VPD with the application context.
Any help would be greatly appreciated.
Published by: user8541826 on November 20, 2011 10:11Hello
user8541826 wrote:
Thank you both for your responses. but I have another question:
You can use a query nested as a predicate in the DPV service?Of course; what you can use in a WHERE clause that you type yourself can also be used in the predicate. A good way to do it in a regular query would be:
WHERE client_id IN ( SELECT client_id FROM clients WHERE superv_id = SYS_CONTEXT ('MYCONTEXT', 'sup_id') )
so, according to the policy, you can say something like:
stpredicate := Q'{client_id IN ( SELECT client_id FROM clients WHERE superv_id = SYS_CONTEXT ('MYCONTEXT', 'sup_id') )}';
Note that you don't need NVL in this case. If SYS_CONTEXT returns NULL, then the IN-sup-query will return no rows, the predicate will be FALSE, but no error is raised.
-
Using the index of multiple values
Hi guys,.
Trying to assess the benefits of the addition of index of multiple values, a quick question on the index of multiple values:
Here's my content from the cache:
Key (EmpID), value [employee (age int, double salary, Department of String)]
(1, new employee (25, 35000.0, "Admin"));
(2, new employee (22, 30000.0, "Admin"));
(3, new employee (34, 40000.0, 'Communications'));
(4, new employee (36, 41000.0, "Admin"));
(5, new employee (36, 42000.0, "HR"));
(6, new employee (29, 30000.0, "HR"));
(7, new employee (51, 50000.0, "BackOffice"));
(8, new employee (36, 35000.0, "HR"));
(9, new employee (46, 45000.0, "Admin"));
(10, new employee (48, 47000.0, "HR"));
If I still want to find all employees in the 'Human resources' Department and whose salary is more than 35000.
Eventually, I would like to do the following:
ValueExtractor salExtractor = new PofExtractor (Integer.class, 2);
ValueExtractor depExtractor = new PofExtractor (String.class, 3);
cache.addIndex (salExtractor, false, null);
cache.addIndex (depExtractor, false, null);
EqualsFilter departmentFilter = new EqualsFilter (depExtractor, 'HR');
GreaterFilter salFilter = new GreaterFilter (salExtractor, 35000);
Filter allFilter = new AllFilter (new filter [] {departmentFilter, salFilter});
Employees value = cache.entrySet (allFilter));
For my usecase above how can I use the indexing of multiple values to the same query?
ValueExtractor salExtractor = new PofExtractor (Integer.class, 2);
ValueExtractor depExtractor = new PofExtractor (String.class, 3);
MultiExtractor mExtractor is new MultiExtractor (new ValueExtractor [] {salExtractor, depExtractor});.
cache.addIndex (mExtractor, false, null);
But how can I use the extractor to create multivalued filter queries for employees in the Department of human resources with greater than 35000 salary? Any ideas are much appreciated.
Thank youD wrote:
Hi guys,.Trying to assess the benefits of the addition of index of multiple values, a quick question on the index of multiple values:
Here's my content from the cache:
Key (EmpID), value [employee (age int, double salary, Department of String)]
(1, new employee (25, 35000.0, "Admin"));
(2, new employee (22, 30000.0, "Admin"));
(3, new employee (34, 40000.0, 'Communications'));
(4, new employee (36, 41000.0, "Admin"));
(5, new employee (36, 42000.0, "HR"));
(6, new employee (29, 30000.0, "HR"));
(7, new employee (51, 50000.0, "BackOffice"));
(8, new employee (36, 35000.0, "HR"));
(9, new employee (46, 45000.0, "Admin"));
(10, new employee (48, 47000.0, "HR"));If I still want to find all employees in the 'Human resources' Department and whose salary is more than 35000.
Eventually, I would like to do the following:
ValueExtractor salExtractor = new PofExtractor (Integer.class, 2);
ValueExtractor depExtractor = new PofExtractor (String.class, 3);
cache.addIndex (salExtractor, false, null);
cache.addIndex (depExtractor, false, null);EqualsFilter departmentFilter = new EqualsFilter (depExtractor, 'HR');
GreaterFilter salFilter = new GreaterFilter (salExtractor, 35000);
Filter allFilter = new AllFilter (new filter [] {departmentFilter, salFilter});
Employees value = cache.entrySet (allFilter));For my usecase above how can I use the indexing of multiple values to the same query?
ValueExtractor salExtractor = new PofExtractor (Integer.class, 2);
ValueExtractor depExtractor = new PofExtractor (String.class, 3);
MultiExtractor mExtractor is new MultiExtractor (new ValueExtractor [] {salExtractor, depExtractor});.
cache.addIndex (mExtractor, false, null);But how can I use the extractor to create multivalued filter queries for employees in the Department of human resources with greater than 35000 salary? Any ideas are much appreciated.
Thank you
I remember, values multiple index refers to a different concept: a multivalued index means that you can retrieve a collection of values of similar role of an attribute on which you can do Contains, ContainsAll filtering, and ContainsAny.
In this case to fully the lever consistency of querying capabilities, you would
- either add a sorted index with a custom comparator that compares the tables containing a salary and a Department on a first salary so the base of the Department and add a filter custom which is able to take advantage of the index for the request for the salary and also able to filter on the element of the array of index service
-Add two independent indices (a sorted index of wages and a unsorted for the Department), in which case you can leverage all existing (GreaterThanFilter, EqualsFilter and AndFilter) codeBest regards
Robert
-
How to use the context of spring to the sca
Can Hi anyone tell me how to use the context of spring in bpel and how the context of spring in composite service feature architecture (sca)Envoy
-
Hello!
I am writing to report a problem I have with the new patch v35 and v35.0.1 Firefox address bar
With the new version 35 of Firefox on Mac OSX Yosemite, clicking with the right mouse button in the address bar to copy the web address, a context menu DO NOT allowed to copy the link, he shaded in grey, inactive... you click on an other browser zone before returning to click a second time and be able to copy the link in the context menu
I mean, with the first right click on the menu bar that appears to address do not allow me to copy the link directly, you must click another area and then click again with the right mouse button in the address bar to copy the Internet address (happens to all pages)
I tried to open Firefox plugins and completed inactive and reset Firefox on first use (as the first installation) and the problem is here again... The problem with or without add-ins and plugins is here
What happens before and then when I format my computer
Here I put a screenshot that explains the problem better than my words
http://i.imgur.com/QxKd8P1.gifI hope you can help me
Hello
I want to just inform you that with the new version 36 of Firefox, this problem has been corrected in my browser
Now I can access the copy option in the context menu directly in the address bar
Thanks for the replies -
I discovered that even open the context menu, without even a selection causes this to happen. I've uninstalled and reinstalled the software. Here is my system info:
Name of the operating system Microsoft Windows 7 Home Premium
Version 6.1.7601 Service Pack 1 Build 7601
Another Description of the OS is not available
Manufacturer of operating system Microsoft Corporation
System name RAY - PC
System manufacturer Hewlett-Packard
HP HDX 18 Notebook PC model system
System Type x 64-based PC
Processor Intel (r) Core (TM) 2 Duo processor T9400 2.53 GHz, 2534 MHz, 2 Lossnay, 2 logical processors
BIOS Version/Date Hewlett-Packard F.04, 01/10/2008
SMBIOS Version 2.4
Windows directory C:\Windows
System directory C:\Windows\system32
Boot Device \Device\HarddiskVolume1
The local United States
Hardware Abstraction Layer Version = "6.1.7601.17514".
User name Ray-PC\Ray
Time Zone MST
Physical memory (RAM) installed 4.00 GB
Total physical memory 4.00 GB
2.42 GB available physical memory
11.8 GB total virtual memory
10.1 GB available virtual memory
7.81 GB page file spaceHelp!
Hello
Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.
(If you use it, switch to the default theme).
- You can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
- Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.
Once you get the pop-up, simply select "" boot mode safe. "
If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .
To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.
When find you what is causing your problems, please let us know. It might help others who have the same problem.
Thank you.
-
Seq context in multiple executions
Hi, I have to change the values of local variables TS of LV directly without the context of the sequence. I mean, I have a VI that is running standalone, it is not called by TS. Then I should only use the TS APIs. The use of these APIs I can access the global station as you can see in the attached file. I use a model of batch/parallel, then I need the context of each sequence is run.
Can someone help me?
I found a work around the use of the PostUImessage TS, but it does not work properly.
Thank you
-
How to use the context menu of the 10 Blackberry in my app using Air
Hey please help me
How do I use the native bb 10 context menu, I got contextmenuevent class to access the events, but I don't know how to add the context menu as long press on any image.
Is there a documentation or extract is available?
There are several threads on this and can be found from the search field. Here is the one who can answer your question:
-
Use a BitmapField to multiple screens...
How can I add a LabelField in multiple screen.
his gift of illigalexception.
even I want to dynamically set images on a BitmapField() in a static way.
But his rising illigalexception in both cases.
You cannot add a field twice. is there a reason why you would want?
If you divide your level of data and user interface, you can load bitmaps into your class of data once and reuse it for each bitmapfield you create.
or you can pass multiple screens using several officials, with a fixed part of the screen remains the same.
Maybe you are looking for
-
Pavilion 15-n003tx: replacement card mother HP
I have a Hp Pavilion laptop which the warranty period has expired. A few days ago, he got shut down and never restarted. To the service center, I learned that the motherboard of the laptop is faulty and must be replaced. Can I get my motherboard repl
-
Laws of the consumer when buying outside the UK/EU
Small question, which I'm sure I know the answer already (just want to be certain). I live in England and I'm going to the United States next month. If I buy a laptop there (because it's cheaper) and bring it to the United Kingdom, I always would fal
-
<; CLOSED >; cannot unlock the bootloader XT1022
Hello you want to ask, I want to unlock my Moto E bootloader, but he always tells me that my device cannot be unlocked, I just tried for 3-4 browsers with all extensions disabled, but it always seems failed. has anyone have the same problem with me?
-
What are the files ".hex".
Can someone help me with this problem? Filename = ihp_120.hex I tried to open the file above without success. Windows XP asks for details of the file or the program that was used to create this file. As I have already downloaded this file that I ha
-
Bring the problem with the installation of Muse CC. Exit code: 39
Hi good night, my problem is the following, when I try to download Adobe Muse, every time, when the load is 42%, always show me the following error:Exit code: 39Please see specific errors below for troubleshooting. For example, ERROR: DW042...-------