Text index getting dropped on SET NULL?
I am using Oracle 11g2 XE. With the following text index settings:
ctx_ddl.create_preference('wrld_lexer', 'WORLD_LEXER');
ctx_ddl.create_preference('TextIDX_preference', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute('TextIDX_preference', 'columns', '"dummy", "FieldVarChar2", "FieldCLOB"');
ctx_ddl.create_preference('wrdlist', 'BASIC_WORDLIST');
ctx_ddl.set_attribute('wrdlist','PREFIX_INDEX','TRUE');
ctx_ddl.set_attribute('wrdlist','PREFIX_MIN_LENGTH', '1');
ctx_ddl.set_attribute('wrdlist','PREFIX_MAX_LENGTH', '15');
ctx_ddl.set_attribute('wrdlist','SUBSTRING_INDEX', 'YES');
ctx_ddl.set_attribute('wrdlist','WILDCARD_MAXTERMS', 5000) ;
ctx_ddl.create_stoplist('universal_stoplist','BASIC_STOPLIST');
CREATE INDEX TextIDX ON "TextTable"("dummy")
INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS
('DATASTORE ME.TextIDX_preference LEXER ME.wrld_lexer WORDLIST ME.wrdlist STOPLIST ME.universal_stoplist FILTER CTXSYS.AUTO_FILTER SYNC (ON COMMIT)');The "FieldCLOB" is a nullable CLOB field is quite volatile. I have a task scheduled in Oracle to execute a stored procedure that first sets the whole column to NULL and afterwards inserts a bunch of text, ranging from a couple of words to over 4000 characters. It seems that whenever that stored procedure is called, afterwards my search engine can't find a thing! When I drop and create the index, it works again.. to a degree. It seems that the text index doesn't want to search on the FieldCLOB. It ignores it.
Why is that so?
I should note that I am fairly new to Oracle and I don't really know where to begin on this problem.
I knew I've forgotten to add something to the question.
The thing is that I am aware of that and I do have the trigger defined:
create or replace
trigger Text_trigger
before update on "TextTable"
for each row
begin
:new."dummy" := :new."dummy";
end;This has worked in the past, but it seems that the changes I've made to the scheduled procedure drops the whole index or something. Here is my sproc:
UPDATE "TextTable"
SET "FieldCLOB" = NULL;
commit;
FOR pair IN (select "Find", "Append" from "Table1")
LOOP
update "TextTable"
set "FieldCLOB" = "FieldCLOB" || pair."Append"
where ID in
(select ID from "TextTable"
where contains("dummy", pair."Find") > 0);
commit;
END LOOP;
-- The problems started when I added this to the scheduled procedure:
FOR pair IN (select "Find", "Append" from "Table2")
LOOP
update "TextTable"
set "FieldCLOB" = "FieldCLOB" || pair."Append"
where ID in
(select ID from "TextTable"
where contains("dummy", pair."Find") > 0);
commit;
END LOOP;Edited by: 981243 on Mar 8, 2013 2:20 AM
Similar Messages
-
Does text index gets effected by "line too long" -- File_datastore
I am trying to create text index using following index script:
create index T_SRCH_IND_DF_IDX
on t_search_index(data_filesystem)
indextype is ctxsys.context
parameters ('DATASTORE myDS
lexer lxrprtjoins
filter MY_FILTER
format column fmt
memory 10M');
Index gets created on some files. For other files (xml,pdf, txt) I get :
DRG-11513 unable to open or write to file %s
One thing i noted in these files is that all these files have
"Line too long" when accessed using "vi" editor.
Does Line being too long matters on text index creation?
Also I get multiple "DRG-11513 unable to open or write to file %s"
for same file oracle tries to index in ctx_user_index_errors. Why not
just one mesg is enough? Please advise...
Thanks a lot.
TahirGarrett, Thanks for ur response.
I am doing exactly what U advised. I loaded one of the file for which i was getting error mesg in
a table a BFILE. try to read it using DBMS_LOB.READ. Below is the Procedure thatI am using to do all this.
create or replace PROCEDURE ReadBLOB IS
src_lob bfile; ---- modify datatype bfile to BLOB if trying to tread blob
buffer RAW(32767);
retval integer;
amt BINARY_INTEGER := 32767;
pos INTEGER := 2147483647;
BEGIN SELECT docs INTO src_lob FROM del_bfile_table WHERE key = '1';
DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
Retval := DBMS_LOB.ISOPEN(src_lob);
DBMS_OUTPUT.PUT_LINE('IS OPEN? = '||retval);
LOOP
dbms_lob.read (src_lob, amt, pos, buffer);
DBMS_OUTPUT.put_line('Cut = '||UTL_RAW.cast_to_varchar2(buffer)||' ...');
DBMS_OUTPUT.put_line('Length = '||to_char(DBMS_LOB.GetLength(src_lob)));
pos := 1;
pos := pos + amt;
DBMS_OUTPUT.put_line('pos = '||pos);
END LOOP;
EXCEPTION WHEN NO_DATA_FOUND THEN dbms_output.put_line('End of data');
END;
I get back 1 for retval. Funny thing is I am not able to get anything print anything
using DBMS_OUTPUT.put_line after dbms_lob.read line in the code. Can't even print
'Hello World'.
Any idea why?
Thanks a lot.
Tahir Dildar. -
Full text index searching in large document sets
I have been placed in charge of a digital PDF document library for a small biotech company. The library consists of about 1000 100-300 page .pdf documents which have been scanned and OCRed. In order to facilitate the full text searching of the documents a PDX catalog has been created. In theory, the PDX catalog would seem to be an excellent means of quickly accessing the data, but due the sheer volume of text that is contained in the documents this does not seem to be the case.
Any given search may take hours to complete and many computers in the department have been known to lock up due to the load of running a search. Obviously, this has made using the PDX search more of a hassle than it is worth.
I do not know exactly how the index searches work, but from what I gather they somehow search within each document in turn and return to you all the instances in all the documents that contain a certain term. If this is the case, than it would make sense that the searches would take a long time because the search would have to search each of the 1000 documents in sequence.
The thing is: we really do not need to know the context and placement of every instance that a word appears in a document. All we need to know is IF it appears, and perhaps how many times. Is there a way to make an index that will simply give us this information without having to search the actual document?
Heres an example of what I am trying to achieve:
Note: I know almost nothing about full text indexes so please forgive me if any of this sounds insane
Lets say we have a document called "word count.pdf" which contained the following text:
"blah blah yadda yadda text Recombinant human insulin more text still texting and so on"
And another called "word count 2.pdf" with the following text
"Recombinant human insulin and la la la dee do"
The indexes for these files could be condensed and stored like this:
"Word count.pdf"
Blah 2
yadda 2
recombinant 1
human 1
insulin 1
text 2
texting 1
and 1
so 1
on 1
"Word count 2.pdf"
recombinant 1
human 1
insulin 1
and 1
la 3
dee 1
do 1
In this example, if we were to run a search on "text" the index would return "word count.pdf, 3 instances (2 of text and 1 of texting" whereas if we were to search for "recombinant" it would return both "word count.pdf, 1 instance" and "word count 2.pdf, 1 instance".
This way, I could quickly weed out all documents that do not have the word that I am looking for and get an idea about which documents should be searched more in depth without scanning every single instance of the term in every document.
Is there any way to accomplish something similar to this using acrobat? (Or anything else, for that matter)
My specifications: (similar to specs of all computers searching the pdx):
Windows XP,
intel celeron CPU 2.6GHz, 1G of ram
Adobe Acrobat 8 ProfessionalLook at dTSearch. We used the publisher version for a CD with large files sets (with hundreds of pages per file/thousands of PDF pages of multicolumn index data - text heavy), and it does a great job. The desktop version would provide the type of searching you are looking for. Indexing is also very fast. Our customer complained, like yourself, about the speed of searches in Acrobat 6 and higher - most of the delay is due to the population of the results window.
http://www.dtsearch.com/ -
Hi all,
I have a Item UIDRef but facing a problem for getting data as set in "text on path option" dailog box for each "text on path" item.
What I did:
- Getting the pointer "IMainItemTOPData" using item UIDRef as
InterfacePtr<IMainItemTOPData> mainItemTOPData(shapesUIDRef, UseDefaultIID());
- This interface has the method GetTOPOptionData () which return ITOPOptionsData pointer
- But SDK don't have "ITOPOptionsData" class implementation.
Second Approch:
- Used "ITextOnPathSelectionSuite" and getting the correct result for Desktop plugin.But I want the correct result in server plugin also.
Anyone who has an idea how to get this using UIDRef, please let me know.
Regards,
Jitendra Kumar SinghHi Pulse,
Unfortunately, Flex doesn't currently support text on a path. However, I binged it and found this:
http://blog.tsclausing.com/post/49
That might be useful.
-Adam -
When I receive calls I always get the option to remind me later, but only certain times I get the option to respond with text. Is there a setting I need to update to always get this option? Also i can't use location reminders. Is this because my calendar is in Outlook?
The only known way to make it work on an external drive is by first installing Windows onto an internal drive, then cloning the install to an external Thunderbolt drive. Thunderbolt is seen as an extension of the internal bus, so Windows doesn't see it as an external device.
-
Hi
I have several applications and I am working on making some kind of APEX "SSO".
An user is authentified in one application. Then he may go to another application. The cookie has the same name from one application to another. The session ID is preserved from one application to another : i use this kind of URL : "f?p=109:1:&SESSION.:"
I have seen that I need to authentify automatically the user when he swap to another application. For that i have a process in the welcome page that authentify the user, using the :app_user and the password, a PL/SQL after header:
wwv_flow_custom_auth_std.login(
P_UNAME => :APP_USER,
P_PASSWORD => :P1_PASSWORD,
P_SESSION_ID => v('APP_SESSION'),
P_FLOW_PAGE => :APP_ID||':1'
);So far so good. User is authenticated. The problem I face is that this message appears :
Content-type: text/html; charset=UTF-8 Set-Cookie: TELEGESTION_AUTH=-1; path=/; Location: /pls/apex/f?p=109:1How to get rid of this message ?
Thank you for your kind help !
Christian
PS: My question has not been answered... I hope somebody could help me on this topic.
Edited by: Christian from France on Mar 4, 2010 2:02 AMHi
Have you tried using "f?p=109:1:&APP_SESSION.:" instead of "f?p=109:1:&SESSION.:".
I don't see why you need to reauthenticate if they're in the same workspace?
Cheers
Ben -
Get Last Sync and Last Full/Fast Optimization time of a Text Index
Hi,
How to get when a text index was last Sync and Last Full/Fast Optimization in oracle 10g and 11g
- Nimish GargHi,
to my knowledge Oracle will not keep this kind of data (I can not find any view in CTXSYS schema which gives this information. Depending on the method of synching there are some options:
- If you used 'SYNC (ON COMMIT"), then the index is always synched and there is no date to be found
- If you used 'Every "interval"', there is a job created (select idx_sync_jobname from ctx_user_indexes). You can find the last runtime of this job to get the last sync date
- If you used 'MANUAL', then the Sync is up to you. You can query CTX_USER_PENDING for the index. In this table the records are recorded which need to be synced. So the lowest PND_TIMESTAMP will give you an idea, of the possible last sync date, it is before this timestamp.
If you do it manual, you can of course keep your own table which records the date.
Herald ten Dam
http://htendam.wordpress.com -
Text Index works fine consistently with Table, but not on underlying View
Hi,
We are facing weird issue relating to Oracle Text Indexes. Search using Oracle Text Index
works fine on a Table, but when running query on View it gives sometimes (not consistently)
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
Sometimes it works.
All of the below steps are run using User IR2OWNER:
STEP 1: Table CPF_CUSTOMER created as follows (3 Non Text Indexes defined at time of creation )
**Please note no Public Synonym is created for this Table**
** There is already another Table by same name CPF_CUSTOMER under different Owner (CDROWNER)
and that Table has Public Synonym CPF_CUSTOMER created. Other Table CPF_CUSTOMER does not
have any Views **
create table CPF_CUSTOMER
CPF_CUSTOMER_UUID NUMBER(20) not null,
SAP_ID VARCHAR2(10 CHAR) not null,
IRIS2_ID VARCHAR2(7 CHAR),
NAME VARCHAR2(70 CHAR) not null,
DRAFT_IND NUMBER(1) not null,
ACTIVE_IND NUMBER(1) not null,
REPLACED_BY_CUST VARCHAR2(10 CHAR),
CRE_DT_GMT DATE,
CRE_DT_LOC DATE,
TIME_ZONE VARCHAR2(3 CHAR),
CRE_USR VARCHAR2(8 CHAR),
CHG_DT_GMT DATE,
CHG_DT_LOC DATE,
CHG_TIME_ZONE VARCHAR2(3 CHAR),
CHG_USR VARCHAR2(8 CHAR),
VFY_DT_GMT DATE,
VFY_DT_LOC DATE,
VFY_USR VARCHAR2(8 CHAR),
DIVISION VARCHAR2(20 CHAR),
SALES_ADMIN VARCHAR2(3 CHAR),
MF_CUST_CDE VARCHAR2(14 CHAR),
CR_CTRL_OFCE VARCHAR2(3 CHAR),
DEFAULT_INV_CCY VARCHAR2(3 CHAR),
AUTOBILL_OVRRD_IND NUMBER(1) not null,
AUTOBILL NUMBER(1) not null,
AUTOPRT_OVRRD_IND NUMBER(1) not null,
AUTOPRT NUMBER(1) not null,
AVE_PYMT_DAY NUMBER(3),
TTL_INV_VAL NUMBER(12,2),
INHERIT_CR_TERM_ASSGMT NUMBER(1) not null,
NORMALIZED_NME VARCHAR2(70 CHAR),
OB_PYMT_OFCE VARCHAR2(3 CHAR),
IB_PYMT_OFCE VARCHAR2(3 CHAR),
CGO_SMART_ID VARCHAR2(20 CHAR),
REC_UPD_DT TIMESTAMP(6),
NCPF_CUST_ID VARCHAR2(7) not null,
CPF_CUST_LEVEL_UUID NUMBER(20) not null
tablespace DBCPFP1_LG_DATA LOGGING;
CREATE UNIQUE INDEX CPF_CUSTOMERI1 ON CPF_CUSTOMER
(SAP_ID ASC) TABLESPACE DBCPFP1_LG_INDX;
ALTER TABLE CPF_CUSTOMER
ADD CONSTRAINT CPF_CUSTOMERI1 UNIQUE (SAP_ID);
CREATE UNIQUE INDEX CPF_CUSTOMERI2 ON CPF_CUSTOMER
(CPF_CUSTOMER_UUID ASC) TABLESPACE DBCPFP1_LG_INDX;
ALTER TABLE CPF_CUSTOMER
ADD CONSTRAINT CPF_CUSTOMERI2 UNIQUE (CPF_CUSTOMER_UUID);
CREATE INDEX CPF_CUSTOMER_IDX2 ON CPF_CUSTOMER (UPPER(NAME))
TABLESPACE DBCPFP1_LG_INDX;
STEP 2: Create View CPF_CUSTOMER_RVW on above Table (and Public Synonym on View)
This View is created under same OWNER as Table created in STEP 1 (IR2OWNER)
create or replace view cpf_customer_rvw as
select
CPF_CUSTOMER_UUID,
SAP_ID,
IRIS2_ID,
NAME,
DRAFT_IND,
ACTIVE_IND,
REPLACED_BY_CUST,
CRE_DT_GMT,
CRE_DT_LOC,
TIME_ZONE,
CRE_USR,
CHG_DT_GMT,
CHG_DT_LOC,
CHG_TIME_ZONE,
CHG_USR,
VFY_DT_GMT,
VFY_DT_LOC,
VFY_USR,
DIVISION,
SALES_ADMIN,
MF_CUST_CDE,
CR_CTRL_OFCE,
DEFAULT_INV_CCY,
AUTOBILL_OVRRD_IND,
AUTOBILL,
AUTOPRT_OVRRD_IND,
AUTOPRT,
AVE_PYMT_DAY,
TTL_INV_VAL,
INHERIT_CR_TERM_ASSGMT,
NORMALIZED_NME,
OB_PYMT_OFCE,
IB_PYMT_OFCE,
CGO_SMART_ID,
NCPF_CUST_ID,
CPF_CUST_LEVEL_UUID,
REC_UPD_DT
from CPF_CUSTOMER;
CREATE OR REPLACE PUBLIC SYNONYM CPF_CUSTOMER_RVW FOR CPF_CUSTOMER_RVW;
STEP 3: Insert Test row
insert into cpf_customer (CPF_CUSTOMER_UUID, SAP_ID, IRIS2_ID, NAME, DRAFT_IND, ACTIVE_IND, REPLACED_BY_CUST, CRE_DT_GMT, CRE_DT_LOC, TIME_ZONE, CRE_USR, CHG_DT_GMT, CHG_DT_LOC, CHG_TIME_ZONE, CHG_USR, VFY_DT_GMT, VFY_DT_LOC, VFY_USR, DIVISION, SALES_ADMIN, MF_CUST_CDE, CR_CTRL_OFCE, DEFAULT_INV_CCY, AUTOBILL_OVRRD_IND, AUTOBILL, AUTOPRT_OVRRD_IND, AUTOPRT, AVE_PYMT_DAY, TTL_INV_VAL, INHERIT_CR_TERM_ASSGMT, NORMALIZED_NME, OB_PYMT_OFCE, IB_PYMT_OFCE, CGO_SMART_ID, NCPF_CUST_ID, CPF_CUST_LEVEL_UUID, REC_UPD_DT)
values (2.26283572796028E15, '6588125000', '6588125', 'S M Mooseen And Sons(PVT) Limited', 0, 1, '', to_date('15-03-2005 08:55:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('15-03-2005 14:25:00', 'dd-mm-yyyy hh24:mi:ss'), 'IST', 'licr2', to_date('19-02-2007 00:33:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('19-02-2007 06:03:00', 'dd-mm-yyyy hh24:mi:ss'), 'IST', 'BaseAdmi', to_date('15-03-2005 09:03:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('15-03-2005 14:33:00', 'dd-mm-yyyy hh24:mi:ss'), 'ninwasa', '', '', 'SRI06588125000', '463', '', 0, 0, 0, 0, null, null, 0, 'SMMOOSEENANDSONSPVTLIMITED', '', '', '', '6588125', 109966195050333, '14-JAN-09 02.49.28.325774 PM');
commit;
STEP 4: Create Oracle Text Index on Table CPF_CUSTOMER
EXEC CTX_DDL.DROP_PREFERENCE('CTXCAT_IR2_STORAGE');
EXEC CTX_DDL.CREATE_PREFERENCE('CTXCAT_IR2_STORAGE', 'BASIC_STORAGE');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'K_TABLE_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'R_TABLE_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_ROWID_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX storage (INITIAL 5M)');
-- Define IR2_AB_LEXER to handle Special Characters.
EXEC ctx_ddl.drop_preference('IR2_AB_LEXER');
EXEC ctx_ddl.create_preference('IR2_AB_LEXER', 'BASIC_LEXER');
EXEC ctx_ddl.set_attribute ('IR2_AB_LEXER', 'printjoins', ',_!$~%?=({;|&+-:/)}.@`^');
--Drop Indexes
drop index CPF_CUSTOMER_DIDX1;
-- CATSEARCH INDEX on CPF_CUSTOMER.NAME
CREATE INDEX CPF_CUSTOMER_DIDX1 ON CPF_CUSTOMER(NAME) INDEXTYPE IS CTXSYS.CTXCAT PARAMETERS ('STORAGE CTXCAT_IR2_STORAGE STOPLIST CTXSYS.EMPTY_STOPLIST LEXER IR2_AB_LEXER');
commit;
STEP 5: Run Query to use Oracle Text Index on Base Table (works fine always. No issues seen so far)
SELECT a.sap_id||'|'||a.name||'|' CUSTOMER_STR
FROM cpf_customer a
WHERE (catsearch(a.name, 'Mooseen'||'*', '')>0);
CUSTOMER_STR
6588125000|S M Mooseen And Sons(PVT) Limited|
STEP 6: Run Query to use Oracle Text Index on View created under Table (get below error periodically)
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
But it works sometimes as in STEP 5 and returns 1 row. It is never consistent. We would like to
provide access to this Table using View only. That is why we would like to get this query working consistently
using View.
Any help or tips would be greatly appreciated
Thanks
AuroThis is a known issue with CTXCAT indexes. Sometimes the optimizer will "drive" the query off another index, and request results from the CTXCAT index on a row-by-row basis ("does the row with rowid NNNN satisfy this CATSEARCH condition?"). That's known as a functional lookup, and is not supported by the CTXCAT indextype.
The only solution is to try to persuade the optimizer to use a different plan which does not use a functional lookup. This can be achieved by the use of hints, or sometimes by collecting or deleting statistics on the table. -
Oracle Text Indexing performance in Unicode database
Forum folks,
I'm looking for overall performance thoughts in Text Indexing within a Unicode database. Part of our internal testing suites includes searching on values using contains filters over indexed binary and text documents. We've architected these tests such that they could be run in a suite or on their own, thus, the data is loaded at the beginning of each test and then the text indexes are created and populated prior to running any of the actual testing.
We have the same tests running on non-unicode instances of Oracle 11gR2 just fine, but when we run them against a Unicode instance, we are almost always seeing timing issues where the indexes haven't finished populating, thus our tests are saying we've only found n number of hits when we are expecting n+ 50 or in some cases n + 150 records to be returned.
We are just looking for some general information in regards to text indexing performance in a unicode database. Will we need to add sleep time to the testing to allow for the indexes to populate? How much time? We would rather not get into having to create different tests for unicode vs non-unicode, but perhaps that is necessary.
Any insight you could provide would be most appreciated.
Thanks in advance,
DanRoger,
Thanks much for your quick reply...
When you talk about Unicode, do you mean AL32UTF8?
--> Yes, this is the Unicode charset we are using.
Is the data the same in both cases, or are you indexing simple 7-bit ascii data in the one database, and foreign text (maybe Chinese?) in the UTF8 database?
With the same data, there should be virtually no difference in performance due to the AL32UTF8 database character set.
--> We have a data generation tool we utilize. For non-unicode data, we generate using all 256 characters in the ISO-8859-1 set. With our Unicode data for clobs, we generate using only the first 1,000 characters of UTF8 by setting up an array of code points...0 - 1000. For Blobs, we have sets of sample word documents and pdfs that are inserted, then indexed.
I'm not sure I understand your testing methodology. Do you run ( load-data, index-data, run-queries ) sequentially?
--> That is correct. We utilize the ctx_ddl package to populate the pending table and then to sync the index....The following is an example of the ddl we generate to create and populate the index:
create index "DBMEARSPARK_ORA80"."RESRESUMEDOC" on "DBMEARSPARK_ORA80"."RESUME" ("RESUMEDOC") indextype is CTXSYS.CONTEXT parameters(' nopopulate sync (every "SYSTIMESTAMP + INTERVAL ''30'' MINUTE" PARALLEL 2) filter ctxsys.auto_filter ') PARALLEL 2;
execute ctx_ddl.populate_pending('"DBMEARSPARK_ORA80"."RESRESUMEDOC"',null);
execute ctx_ddl.sync_index('"DBMEARSPARK_ORA80"."RESRESUMEDOC"',null,null,2);
If so, there should be no way that the indexes can be half-created. If not, don't you have some check to see if the index creation has finished before running the query test?
--> Excellent question....is there such a check? I have not found a way to do that yet...
Were you just lucky with the "non-unicode" tests that the indexing just happened to have always finished by the time you ran the queries?
--> This is quite possible as well. If there is a check to see if the index is ready, then we could add that into our infrastructure.
--> Thanks, again, for responding so quickly.
Edited by: djulson on Feb 12, 2013 7:13 AM -
Error synchronizing text index in oracle 10g
Hi,
I am getting errors while trying to synchronize the text index on a xmltype table.
SQL> exec ctx_ddl.sync_index('CTX_INDEX');
BEGIN ctx_ddl.sync_index('CTX_INDEX'); END;
ERROR at line 1:
ORA-20000: Oracle Text error:
DRG-50857: oracle error in drsxsopen
ORA-00904: "BASE"."SYS_NC00162$"."GETCLOBVAL": invalid identifier
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.CTX_DDL", line 539
ORA-06512: at line 1
I will appreciate it if someone can help me figure out a solution.
(Oracle database version - 10.2.0.1)
Thanks,
UmaTesting with 10.2.0.2.0 I do not see the problem. Is there something significanly different between your environement and the one in this testcase
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Feb 28 16:16:54 2006
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> spool createTextIndex.log
SQL> --
SQL> connect &1/&2
Connected.
SQL> --
SQL> desc ENTRY_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://www.uniprot.org/support/docs/uniprot.xsd" Element "entry") STORAGE Object-relational TYPE "ENTRY_T"
SQL> /
SP2-0103: Nothing in SQL buffer to run.
SQL> create index UNIPROT_FULL_TEXT
2 on ENTRY_TABLE e (object_value)
3 indextype is ctxsys.context
4 parameters ( 'section group ctxsys.NULL_SECTION_GROUP' )
5 /
Index created.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Feb 28 16:16:58 2006
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> spool loadFile_&3..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/&3',
5 bfilename(USER,'&3'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/&3',
new 4: result := dbms_xdb.createResource('/home/BASE/testcase.xml',
old 5: bfilename(USER,'&3'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'testcase.xml'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.70
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.08
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Feb 28 16:16:59 2006
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> spool testcase.log
SQL> --
SQL> connect &1/&2
Connected.
SQL> --
SQL> --
SQL> -- Testcase code here
SQL> --
SQL> set trimspool on
SQL> set autotrace on explain
SQL> set timing on
SQL> set pages 0 lines 140 long 100000
SQL> --
SQL> select count(*)
2 from ENTRY_TABLE
3 /
1
Elapsed: 00:00:00.21
Execution Plan
Plan hash value: 4248071425
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 20 | 3 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 20 | | |
|* 2 | TABLE ACCESS FULL| ENTRY_TABLE | 1 | 20 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xs
d"><read-properties/><read-contents/></privilege>'))=1)
Note
- dynamic sampling used for this statement
SQL> select object_value
2 from ENTRY_TABLE
3 where existsNode (OBJECT_value, '/entry[accession/text()="P19084"]','xmlns="http://uniprot.org/uniprot"')>0
4 /
*** Object defn.s out of sync w/ data
***<entry xmlns="http://uniprot.org/uniprot" dataset="Swiss-Prot" created="1990-11-01" modified="2006-02-07" version="45">
<accession>P19084</accession>
<name>11S3_HELAN</name>
PLTLWANRYQLSREEAQQLKFSQRETVLFAPSFSRGQGIRASR
</sequence>
</entry>
Elapsed: 00:00:03.13
Execution Plan
Plan hash value: 4171466134
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 10115 | 804 (1)| 00:00:10 |
| 1 | NESTED LOOPS | | 1 | 10115 | 804 (1)| 00:00:10 |
| 2 | SORT UNIQUE | | 1 | 2016 | 802 (0)| 00:00:10 |
|* 3 | INDEX FAST FULL SCAN | ACCESSION_DATA | 1 | 2016 | 802 (0)| 00:00:10 |
|* 4 | TABLE ACCESS BY INDEX ROWID| ENTRY_TABLE | 1 | 8099 | 1 (0)| 00:00:01 |
|* 5 | INDEX UNIQUE SCAN | ACCESSION_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter("ACCESSION_TABLE"."SYS_XDBBODY$"='P19084')
4 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-prop
erties/><read-contents/></privilege>'))=1)
5 - access("NESTED_TABLE_ID"="ENTRY_TABLE"."SYS_NC0001100012$")
Note
- dynamic sampling used for this statement
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Feb 28 16:17:03 2006
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> spool syncTextIndex.log
SQL> --
SQL> connect &1/&2
Connected.
SQL> --
SQL> exec ctx_ddl.sync_index('UNIPROT_FULL_TEXT')
PL/SQL procedure successfully completed.
SQL> /
SP2-0103: Nothing in SQL buffer to run.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-2.05b$Message was edited by:
mdrake -
Multiple text indexes on a single database
Hi,
We want to enable text search on one of our databases. Due to the specificity of the database we want to use a custom thesaurus.
I would like to know if there's a way to create different text indexes using different thesaurus and then specify the index to be used in the query(similar to oracle sql hints).
Thanks,
UmaI don't know how often your data changes or how soon that data needs to be searchable or whether there can be any down time. If you can run a nightly procedure, during which time the data would not be searchable, you can have that procedure synchronize the index, then check all of the indexed tokens against those in your financial terms and those in your stoplist, then add any of the tokens that are not financial terms to your stoplist, then drop and rebuid the index. The new documents will then be searchable. It appears that, in order for the new stopwords to be used, the index must be dropped and recreated, not just rebuilt or synchronized. Please see the example below.
SCOTT@10gXE> CREATE TABLE financial_terms
2 (word VARCHAR2 (60))
3 /
Table created.
SCOTT@10gXE> INSERT ALL
2 INTO financial_terms VALUES ('account')
3 INTO financial_terms VALUES ('balance')
4 INTO financial_terms VALUES ('bank')
5 INTO financial_terms VALUES ('deposit')
6 INTO financial_terms VALUES ('finance')
7 INTO financial_terms VALUES ('loan')
8 INTO financial_terms VALUES ('withdraw')
9 SELECT * FROM DUAL
10 /
7 rows created.
SCOTT@10gXE> CREATE TABLE financial_documents
2 (document CLOB)
3 /
Table created.
SCOTT@10gXE> EXEC CTX_DDL.CREATE_STOPLIST ('non_financial')
PL/SQL procedure successfully completed.
SCOTT@10gXE> CREATE INDEX financial_idx ON financial_documents (document)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS ('STOPLIST non_financial')
4 /
Index created.
SCOTT@10gXE> CREATE OR REPLACE PROCEDURE check_words
2 AS
3 BEGIN
4 CTX_DDL.SYNC_INDEX ('financial_idx');
5 FOR r IN
6 (SELECT token_text
7 FROM dr$financial_idx$i,
8 (SELECT UPPER (word) AS word
9 FROM financial_terms
10 UNION ALL
11 SELECT UPPER (spw_word) AS word
12 FROM ctx_stopwords
13 WHERE spw_stoplist = 'NON_FINANCIAL')
14 WHERE token_text = word (+)
15 AND word IS NULL)
16 LOOP
17 CTX_DDL.ADD_STOPWORD ('NON_FINANCIAL', r.token_text);
18 END LOOP;
19 EXECUTE IMMEDIATE 'DROP INDEX financial_idx';
20 EXECUTE IMMEDIATE
21 'CREATE INDEX financial_idx ON financial_documents (document)
22 INDEXTYPE IS CTXSYS.CONTEXT
23 PARAMETERS (''STOPLIST non_financial'')';
24 END check_words;
25 /
Procedure created.
SCOTT@10gXE> SHOW ERRORS
No errors.
SCOTT@10gXE> INSERT ALL
2 INTO financial_documents VALUES ('bank account')
3 INTO financial_documents VALUES ('loan application')
4 INTO financial_documents VALUES ('test of other words')
5 SELECT * FROM DUAL
6 /
3 rows created.
SCOTT@10gXE> COMMIT
2 /
Commit complete.
SCOTT@10gXE> EXECUTE check_words
PL/SQL procedure successfully completed.
SCOTT@10gXE> SELECT spw_word
2 FROM ctx_stopwords
3 WHERE spw_stoplist = 'NON_FINANCIAL'
4 /
SPW_WORD
APPLICATION
OF
OTHER
TEST
WORDS
SCOTT@10gXE> SELECT token_text FROM dr$financial_idx$i
2 /
TOKEN_TEXT
ACCOUNT
BANK
LOAN
SCOTT@10gXE> SELECT * FROM financial_documents
2 WHERE CONTAINS (document, 'account OR loan OR test') > 0
3 /
DOCUMENT
bank account
loan application
SCOTT@10gXE> -
Embedding Full-text Index into PDF File
Hello Everyone,
I've tried to create and embed full-text index into PDF file, but with no luck. I've followed steps described at http://help.adobe.com/en_US/Acrobat/9.0/Standard/WSC28D4DBB-6A78-4027-9E04-F50FE411CFB9.w. html - there can be seen progress of collecting of data and at the end the button Update index is enabled. This is signal for me that Index was created. After clicking on Ok button, saving document as new one and then reopening "new created" document, there is info that no Index is embedded in the Manage Embedded Index dialog. Is there any other step necessary to do? Or is it bug? Adobe Acrobat Pro 9.1 on Windows Vista 32bit is used.
Jan
PS: Interesting is also comment at the bottom of above mentioned help page...Thanks for the response. It is true that if I make changes and look at the embedded index status, it shows that it needs updating
However the problem I can't get around after extensive testing is that sometimes for no apparent reason the index is dropped on save. This can happen if I check the status of the index to make sure it is valid, save the file, and reopen it.
I've concluded that this must be a bug and am using other indexing options for the time being. -
Hello
Had a query on oracle Text Index.
1. I have created a table with column ID as sequence & column description as Varchar2(500)
2. Inserted 3 records
3. I created the Oracle Text index on column "description" as INDEXTYPE IS CTXSYS.CONTEXT
4. Run a select using "contains" , get the records as required.
5. I insert another new record & commit;
6. Run the same old query using contains but for the new records I get 0 records
7. Drop the Index and Recreate the index using same old index on column "description" as INDEXTYPE IS CTXSYS.CONTEXT
8. Run the same old query using contains but for the new records and now I get the records as required.
Does that mean every time I insert new records I have to rebuild the Oracle Text Index ?
Your Help will be much appreciated
Regards
HarshadYou need to use some method of updating your index. You can drop and recreate or you can rebuild or you can use ctx_ddl.sync_index or you can include sync(on commit) in your parameters when you create the index or various other methods of periodic synchronization and optimization.
-
Text index for UNION queries.
Hi All,
Can anyone please help me in tuning search query mentioned below
select id from usr1.organizations where lower(ID_official_name) like 'technology%'
union
select id from usr1.organizations where lower(ID_OFFICIAL_NORM_NAME) like 'technology%'
union
select id from usr1.organizations where lower(ID_OFFICIAL_ENG_NAME) like 'technology%'
union
select id from usr1.organizations where lower(ID_OFFICIAL_ENG_NORM_NAME) like 'technology%'
union
select id from usr1.organizations where lower(ID_OFFICIAL_TRANS_NAME) like 'technology%'
union
select id from usr1.ID_ALIAS_NAMEs where lower(ID_ALIAS_NAME) like 'technology%'
union
select id from usr1.ID_ALIAS_NAMEs where lower(ID_ALIAS_NORM_NAME) like 'technology%'
union
select id from usr1.ID_ALIAS_NAMEs where lower(ID_ALIAS_ENG_NAME) like 'technology%'
union
select id from usr1.ID_ALIAS_NAMEs where lower(ID_ALIAS_ENG_NORM_NAME) like 'technology%'
union
select id from usr1.ID_ALIAS_NAMEs where lower(ID_ALIAS_TRANS_NAME) like 'technology%'
union
select id from usr1.ID_DOING_BUSINESS_AS_NAMES where lower(ID_dba_name) like 'technology%'
union
select id from usr1.ID_DOING_BUSINESS_AS_NAMES where lower(ID_DBA_NORM_NAME) like 'technology%'
union
select id from usr1.ID_DOING_BUSINESS_AS_NAMES where lower(ID_DBA_ENG_NAME) like 'technology%'
union
select id from usr1.ID_DOING_BUSINESS_AS_NAMES where lower(ID_DBA_ENG_NORM_NAME) like 'technology%'
union
select id from usr1.ID_DOING_BUSINESS_AS_NAMES where lower(ID_DBA_TRANS_NAME) like 'technology%'
union
select id from usr1.ID_FKA_NAMES where lower(ID_fka_name) like 'technology%'
union
select id from usr1.ID_FKA_NAMES where lower(ID_fkA_NORM_NAME) like 'technology%'
union
select id from usr1.ID_FKA_NAMES where lower(ID_fkA_ENG_NAME) like 'technology%'
union
select id from usr1.ID_FKA_NAMES where lower(ID_fkA_ENG_NORM_NAME) like 'technology%'
union
select id from usr1.ID_FKA_NAMES where lower(ID_fkA_TRANS_NAME) like 'technology%'Here organizations table is the parent table having primary key on id column, and rest all tables are children tables having foreign key on id column referencing to primary key id column in organizations table.
Planning to implement multiple column(Userdatastore) text index on dummy column appended to organizations table. And write triggers on other child tables to trigger the sync for Text index.
But not sure whether we can rewrite this above sql query by replacing union into joins, not sure why developer has not done so.
Can anyone please help me in creating text index for this sql. I do not want to approach cartesian joins as these are having parent-child relationship.
Oracle Version: 10.2.0.4
Please let me know if you need more information1 .As text index is created in parent table on id column, can we somehow search only from particular columns(Parent or child) by using user_datastore and tags for sectioning it?
Below are the sql which i need to make use of text index
select m.id from id_ALIAS_NAMEs an
join organizations m on(m.id=an.id)
where lower(ID_ALIAS_NAME) like 'technology%' and m.id_data_provider<100;
select M.id,ID_ALIAS_NAME,'ID_ALIAS_NAME' AS NAMETYPE
from id_alias_names an JOIN organizations m ON m.id=an.id
where id_data_provider<100 AND coalesce(m.ID_COUNTRY_OF_DOMICILE,m.ID_COUNTRY_OF_INCORPORATION)='US'
AND LOWER(ID_ALIAS_NAME) like LOWER('TECHNOLOGY%')
and F_GetFirstWord(ORG_ALIAS_NAME)='TECHNOLOGY'
The text index must be created on a text column, not a numeric id column. It is common to create it on a dummy column. You can name that column anything you like instead of dummy, like search_columns or some such thing. You can add tags in your procedure, so that your resulting virtual column is like xml data. You can then create a section group, so that you can search within each of those tags. In the example below, I used ctxsys.auto_section_group because it is the simplest to create, but you may get better performance by using another type of section group and naming each individual tag.
SCOTT@orcl_11gR2> -- tables you already have:
SCOTT@orcl_11gR2> create table organizations
2 (id number primary key,
3 id_official_name varchar2 (10),
4 id_official_norm_name varchar2 (10),
5 id_official_eng_name varchar2 (10),
6 id_official_trans_name varchar2 (10),
7 id_data_provider number,
8 id_country_of_domicile varchar2 (10),
9 id_country_of_incorporation varchar2 (10))
10 /
Table created.
SCOTT@orcl_11gR2> create table id_alias_names
2 (id number references organizations (id),
3 id_alias_name varchar2 (10),
4 id_alias_norm_name varchar2 (10),
5 id_alias_eng_name varchar2 (10),
6 id_alias_trans_name varchar2 (10))
7 /
Table created.
SCOTT@orcl_11gR2> create table id_doing_business_as_names
2 (id number references organizations (id),
3 id_dba_name varchar2 (10),
4 id_dba_norm_name varchar2 (10),
5 id_dba_eng_name varchar2 (10),
6 id_dba_trans_name varchar2 (10))
7 /
Table created.
SCOTT@orcl_11gR2> create table id_fka_names
2 (id number references organizations (id),
3 id_fka_name varchar2 (10),
4 id_fka_norm_name varchar2 (10),
5 id_fka_eng_name varchar2 (10),
6 id_fka_trans_name varchar2 (10))
7 /
Table created.
SCOTT@orcl_11gR2> -- test data:
SCOTT@orcl_11gR2> insert all
2 into organizations values (1, 'test', 'name2', 'name3', 'name4', 99, 'US', null)
3 into organizations values (2, 'name1', 'name2', 'name3', 'name4', 99, null, 'US')
4 into organizations values (3, 'name1', 'name2', 'name3', 'name4', 99, null, null)
5 into organizations values (4, 'name1', 'name2', 'name3', 'name4', 101, 'US', 'US')
6 into organizations values (5, 'technology', 'technology', 'technology', 'technology', 99, 'US', 'US')
7 select * from dual
8 /
5 rows created.
SCOTT@orcl_11gR2> insert all
2 into id_alias_names values (1, 'technology', 'name6', 'name7', 'name8')
3 into id_alias_names values (2, 'technology', 'test', 'name7', 'name8')
4 into id_alias_names values (3, 'technology', 'name6', 'name7', 'name8')
5 into id_alias_names values (4, 'technology', 'name6', 'name7', 'name8')
6 into id_alias_names values (5, 'name5', 'technology', 'technology', 'technology')
7 select * from dual
8 /
5 rows created.
SCOTT@orcl_11gR2> insert all
2 into id_doing_business_as_names values (1, 'name9', 'name10', 'name11', 'name12')
3 into id_doing_business_as_names values (2, 'name9', 'name10', 'name11', 'name12')
4 into id_doing_business_as_names values (3, 'name9', 'name10', 'test', 'name12')
5 into id_doing_business_as_names values (4, 'name9', 'name10', 'name11', 'name12')
6 into id_doing_business_as_names values (5, 'technology', 'technology', 'technology', 'technology')
7 select * from dual
8 /
5 rows created.
SCOTT@orcl_11gR2> insert all
2 into id_fka_names values (1, 'name13', 'name14', 'name15', 'name16')
3 into id_fka_names values (2, 'name13', 'name14', 'name15', 'name16')
4 into id_fka_names values (3, 'name13', 'name14', 'name15', 'name16')
5 into id_fka_names values (4, 'name13', 'name14', 'name15', 'test')
6 into id_fka_names values (5, 'technology', 'technology', 'technology', 'technology')
7 select * from dual
8 /
5 rows created.
SCOTT@orcl_11gR2> -- revised procedure to join tables with tags:
SCOTT@orcl_11gR2> create or replace procedure your_proc
2 (p_rowid in rowid,
3 p_clob in out nocopy clob)
4 as
5 begin
6 for r1 in
7 (select id,
8 '<id_official_name>'
9 || id_official_name
10 || '</id_official_name><id_official_norm_name>'
11 || id_official_norm_name
12 || '</id_official_norm_name><id_official_eng_name>'
13 || id_official_eng_name
14 || '</id_official_eng_name><id_official_trans_name>'
15 || id_official_trans_name
16 || '</id_official_trans_name>' as tags_and_values
17 from organizations
18 where rowid = p_rowid)
19 loop
20 dbms_lob.writeappend
21 (p_clob, length (r1.tags_and_values), r1.tags_and_values);
22 for r2 in
23 (select '<id_alias_name>'
24 || id_alias_name
25 || '</id_alias_name><id_alias_norm_name>'
26 || id_alias_norm_name
27 || '</id_alias_norm_name><id_alias_eng_name>'
28 || id_alias_eng_name
29 || '</id_alias_eng_name><id_alias_trans_name>'
30 || id_alias_trans_name
31 || '</id_alias_trans_name>' as tags_and_values
32 from id_alias_names
33 where id = r1.id)
34 loop
35 dbms_lob.writeappend
36 (p_clob, length (r2.tags_and_values), r2.tags_and_values);
37 end loop;
38 for r3 in
39 (select '<id_dba_name>'
40 || id_dba_name
41 || '</id_dba_name><id_dba_norm_name>'
42 || id_dba_norm_name
43 || '</id_dba_norm_name><id_dba_eng_name>'
44 || id_dba_eng_name
45 || '</id_dba_eng_name><id_dba_trans_name>'
46 || id_dba_trans_name
47 || '</id_dba_trans_name>' as tags_and_values
48 from id_doing_business_as_names
49 where id = r1.id)
50 loop
51 dbms_lob.writeappend
52 (p_clob, length (r3.tags_and_values), r3.tags_and_values);
53 end loop;
54 for r4 in
55 (select '<id_fka_name>'
56 || id_fka_name
57 || '</id_fka_name><id_fka_norm_name>'
58 || id_fka_norm_name
59 || '</id_fka_norm_name><id_fka_eng_name>'
60 || id_fka_eng_name
61 || '</id_fka_eng_name><id_fka_trans_name>'
62 || id_fka_trans_name
63 || '</id_fka_trans_name>' as tags_and_values
64 from id_fka_names
65 where id = r1.id)
66 loop
67 dbms_lob.writeappend
68 (p_clob, length (r4.tags_and_values), r4.tags_and_values);
69 end loop;
70 end loop;
71 end your_proc;
72 /
Procedure created.
SCOTT@orcl_11gR2> show errors
No errors.
SCOTT@orcl_11gR2> -- examples of virtual columns that revised procedure returns:
SCOTT@orcl_11gR2> declare
2 v_clob clob;
3 begin
4 for r in
5 (select rowid, id
6 from organizations)
7 loop
8 dbms_lob.createtemporary (v_clob, true);
9 your_proc (r.rowid, v_clob);
10 dbms_output.put_line (r.id);
11 dbms_output.put_line (v_clob);
12 dbms_lob.freetemporary (v_clob);
13 end loop;
14 end;
15 /
1
<id_official_name>test</id_official_name><id_official_norm_name>name2</id_official_norm_name><id_official_eng_name>name3
</id_official_eng_name><id_official_trans_name>name4</id_official_trans_name><id_alias_name>technology</id_alias_name><i
d_alias_norm_name>name6</id_alias_norm_name><id_alias_eng_name>name7</id_alias_eng_name><id_alias_trans_name>name8</id_a
lias_trans_name><id_dba_name>name9</id_dba_name><id_dba_norm_name>name10</id_dba_norm_name><id_dba_eng_name>name11</id_d
ba_eng_name><id_dba_trans_name>name12</id_dba_trans_name><id_fka_name>name13</id_fka_name><id_fka_norm_name>name14</id_f
ka_norm_name><id_fka_eng_name>name15</id_fka_eng_name><id_fka_trans_name>name16</id_fka_trans_name>
2
<id_official_name>name1</id_official_name><id_official_norm_name>name2</id_official_norm_name><id_official_eng_name>name
3</id_official_eng_name><id_official_trans_name>name4</id_official_trans_name><id_alias_name>technology</id_alias_name><
id_alias_norm_name>test</id_alias_norm_name><id_alias_eng_name>name7</id_alias_eng_name><id_alias_trans_name>name8</id_a
lias_trans_name><id_dba_name>name9</id_dba_name><id_dba_norm_name>name10</id_dba_norm_name><id_dba_eng_name>name11</id_d
ba_eng_name><id_dba_trans_name>name12</id_dba_trans_name><id_fka_name>name13</id_fka_name><id_fka_norm_name>name14</id_f
ka_norm_name><id_fka_eng_name>name15</id_fka_eng_name><id_fka_trans_name>name16</id_fka_trans_name>
3
<id_official_name>name1</id_official_name><id_official_norm_name>name2</id_official_norm_name><id_official_eng_name>name
3</id_official_eng_name><id_official_trans_name>name4</id_official_trans_name><id_alias_name>technology</id_alias_name><
id_alias_norm_name>name6</id_alias_norm_name><id_alias_eng_name>name7</id_alias_eng_name><id_alias_trans_name>name8</id_
alias_trans_name><id_dba_name>name9</id_dba_name><id_dba_norm_name>name10</id_dba_norm_name><id_dba_eng_name>test</id_db
a_eng_name><id_dba_trans_name>name12</id_dba_trans_name><id_fka_name>name13</id_fka_name><id_fka_norm_name>name14</id_fk
a_norm_name><id_fka_eng_name>name15</id_fka_eng_name><id_fka_trans_name>name16</id_fka_trans_name>
4
<id_official_name>name1</id_official_name><id_official_norm_name>name2</id_official_norm_name><id_official_eng_name>name
3</id_official_eng_name><id_official_trans_name>name4</id_official_trans_name><id_alias_name>technology</id_alias_name><
id_alias_norm_name>name6</id_alias_norm_name><id_alias_eng_name>name7</id_alias_eng_name><id_alias_trans_name>name8</id_
alias_trans_name><id_dba_name>name9</id_dba_name><id_dba_norm_name>name10</id_dba_norm_name><id_dba_eng_name>name11</id_
dba_eng_name><id_dba_trans_name>name12</id_dba_trans_name><id_fka_name>name13</id_fka_name><id_fka_norm_name>name14</id_
fka_norm_name><id_fka_eng_name>name15</id_fka_eng_name><id_fka_trans_name>test</id_fka_trans_name>
5
<id_official_name>technology</id_official_name><id_official_norm_name>technology</id_official_norm_name><id_official_eng
_name>technology</id_official_eng_name><id_official_trans_name>technology</id_official_trans_name><id_alias_name>name5</
id_alias_name><id_alias_norm_name>technology</id_alias_norm_name><id_alias_eng_name>technology</id_alias_eng_name><id_al
ias_trans_name>technology</id_alias_trans_name><id_dba_name>technology</id_dba_name><id_dba_norm_name>technology</id_dba
_norm_name><id_dba_eng_name>technology</id_dba_eng_name><id_dba_trans_name>technology</id_dba_trans_name><id_fka_name>te
chnology</id_fka_name><id_fka_norm_name>technology</id_fka_norm_name><id_fka_eng_name>technology</id_fka_eng_name><id_fk
a_trans_name>technology</id_fka_trans_name>
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> -- user_datastore:
SCOTT@orcl_11gR2> begin
2 ctx_ddl.create_preference ('your_datastore', 'user_datastore');
3 ctx_ddl.set_attribute ('your_datastore', 'procedure', 'your_proc');
4 end;
5 /
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> -- dummy column:
SCOTT@orcl_11gR2> alter table organizations add (dummy varchar2(1))
2 /
Table altered.
SCOTT@orcl_11gR2> -- index with auto_section_group,
SCOTT@orcl_11gR2> -- must be on a text column, like dummy, not numeric id column:
SCOTT@orcl_11gR2> create index your_index
2 on organizations (dummy)
3 indextype is ctxsys.context
4 parameters
5 ('datastore your_datastore
6 section group ctxsys.auto_section_group')
7 /
Index created.
SCOTT@orcl_11gR2> -- example queries:
SCOTT@orcl_11gR2> select id
2 from organizations
3 where contains (dummy, 'technology within id_alias_name') > 0
4 and id_data_provider < 100
5 /
ID
1
2
3
3 rows selected.
SCOTT@orcl_11gR2> select m.id, an.id_alias_name, 'ID_ALIAS_NAME' as nametype
2 from id_alias_names an join organizations m on m.id = an.id
3 where contains (m.dummy, 'technology within id_alias_name') > 0
4 and m.id_data_provider < 100
5 and coalesce (m.id_country_of_domicile, m.id_country_of_incorporation) = 'US'
6 /
ID ID_ALIAS_N NAMETYPE
1 technology ID_ALIAS_NAME
2 technology ID_ALIAS_NAME
2 rows selected.
SCOTT@orcl_11gR2> -
Setting null values to view.attributes
Hi all, I am getting following NPE posting form to server. Below I m writing snippet of code which causes the issue:
SEVERE: value is null for a not available property: test
java.lang.NullPointerException: value is null for a not available property: test
at javax.faces.component._ComponentAttributesMap.put(_ComponentAttributesMap.java:303)
at javax.el.MapELResolver.setValue(MapELResolver.java:90)
at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:69)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:180)
at org.apache.el.parser.AstValue.setValue(AstValue.java:158)
at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
at org.apache.jasper.el.JspValueExpression.setValue(JspValueExpression.java:85)
at javax.faces.component.UIInput.updateModel(UIInput.java:287)
at javax.faces.component.UIInput.processUpdates(UIInput.java:214)
at javax.faces.component.UIForm.processUpdates(UIForm.java:99)
at org.ajax4jsf.component.AjaxViewRoot$2.invokeContextCallback(AjaxViewRoot.java:424)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:240)
at org.ajax4jsf.component.AjaxViewRoot.processUpdates(AjaxViewRoot.java:440)
at org.apache.myfaces.lifecycle.UpdateModelValuesExecutor.execute(UpdateModelValuesExecutor.java:33)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)My Jsp Page code snippet:
<t:selectOneMenu value="#{view.attributes['test']}">
<f:selectItems value="#{myController.listValues}"/>
</t:selectOneMenu>MyController.java bean property:
public List<SelectItem> getListValues() {
listValues.clear();
SelectItem si = new SelectItem("", "-Select-");
SelectItem si2 = new SelectItem("1", "1");
SelectItem si3 = new SelectItem("2", "2");
listValues.add(si);
listValues.add(si2);
listValues.add(si3);
return listValues;
}When user selects nothing, I need to set NULL value for this drop down. Kindly suggest if there is any other way or best practice to do the same.I am using Myfaces 1.2.5 for JSF 1.2. This thing was working fine in Myfaces 1.1.5 for JSF 1.1.Any suggestions?Give this a try:
<t:selectOneMenu value="#{view.attributes['test']}">
<f:selectItem itemLabel="-Select-" />
<f:selectItems value="#{myController.listValues}"/>
</t:selectOneMenu>
public List<SelectItem> getListValues() {
listValues.clear();
listValues.add(new SelectItem("1", "1");
listValues.add(new SelectItem("2", "2");
return listValues;
}Note: I cleaned up your getListValue() a bit - most of the changes are cosmetic except for removing you '-Select-' selectItem. Also, why do you use a class level variable if you are generating it on each call? Either generate the list on constructor call (or when needed) and just return it from getListValues(), or simply use a local variable.
Maybe you are looking for
-
How to go about building a app that searches for and displays pages from Google.
I was wondering how i would go about building an app that takes a users input such as a sentence (not a URL) and then searches for their input on Google. This app would then have to display a selected page automatically on the UIWebView. My existing
-
WSRP Portlets - HTML elements renamed
Moved from Webcenter Spaces. All, I have a JSR-168 portlet that I WSRP-ed using the wsrp-predeploy tool. I have this registered in Weblogic as a WSRP producer and added to Webcenter Spaces. What I notice is that when rendered on Spaces, the HTML elem
-
Keithley 2000 DMM AC Read Overflow
I've been having problems controlling a Keithley 2000 DMM during AC volts measurement using IVI. When reading AC Volts the DMM will intermittently sense an 'overflow' and return the value NaN. I'm using IVI and TestStand 3.0 but get the same problem
-
How can I download an iPhoto slideshow to a disc or thumb drive?
I want to download a slideshow from IPhoto to a disc or thumb drive but it will only give me iPad, Iphone, computer or TV as possible export locations. I want to make copies of a slideshow for friends and family. What's the secret?
-
Dummy Companies in Sap software
Hi I have a problem in my SAP Software installed recently. I dont have any example companies in my system (like 1000, IDES, etc) to refer to. I dont even have the types of currencies and countries, chart of accounts,fiscal year, field status variants