Skip to Main Content

Database Software

Announcement

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

Using Query Template

759163Sep 29 2010 — edited Sep 29 2010
I am having a problem while using the query template in oracle text,this might be due to my inexperience in this field

so i ask the members of the forum to help me out

i created a table

CREATE TABLE APP_TEST.BOOK_LIST (
ISBN VARCHAR2(21) NOT NULL,
TITLE VARCHAR2(300),
DETAILS VARCHAR2(1000),
PRICE NUMBER(4),
ORA_TEXT_SEARCH VARCHAR2(1000),
CONSTRAINT PK_BOOK_LIST PRIMARY KEY(ISBN)
)

inserted into the columns

INSERT INTO BOOK_LIST (ISBN, TITLE, DETAILS, PRICE, ORA_TEXT_SEARCH)
VALUES('ISBN4-7741-1048-0','java schidlt','java',4500,'')

then i created oracle text indexes

CREATE INDEX APP_TEST.ORA_TEXT_SEARCH_IDX
ON APP_TEST.BOOK_LIST (ORA_TEXT_SEARCH)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('section group CTXSYS.PATH_SECTION_GROUP')

now when i query normally

select * from BOOK_LIST where contains(ORA_TEXT_SEARCH,'(?{java} INPATH(TITLE_SEACH_KEY))',1)>0

then i am getting the proper result

but when i use query template
select * from BOOK_LIST where contains(ORA_TEXT_SEARCH,'<query><textquery><progression><seq>(?{oracle} INPATH(TITLE_SEACH_KEY))</seq><seq>(?{oracle} INPATH(TITLE_SEACH_KEY))</seq></progression></textquery></query>',1)>0

i am getting no results


i got some information from some experts

and i inserted the data into the table by using this way

INSERT INTO BOOK_LIST (ISBN, TITLE, DETAILS, PRICE, ORA_TEXT_SEARCH)
VALUES('ISBN4-7741-1048-0','java schidlt','java',4500,'<TITLE_SEACH_KEY>java schidlt</TITLE_SEACH_KEY><DETAILS_SEACH_KEY>java</DETAILS_SEACH_KEY>><FOO_SEACH_KEY></FOO_SEACH_KEY>')

and now when i execute the query

select * from BOOK_LIST where contains(ORA_TEXT_SEARCH,'<query><textquery><progression><seq>(?{oracle} INPATH(TITLE_SEACH_KEY))</seq><seq>(?{oracle} INPATH(TITLE_SEACH_KEY))</seq></progression></textquery></query>',1)>0

i am getting proper result.

but i am not able to figure it out . please help me out
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2010
Added on Sep 29 2010
6 comments
527 views