Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE
- l_query VARCHAR2(4000);
- BEGIN
- --Sync index to ensure up-to-date records
- ctx_ddl.sync_index('agencies_desc_ctx_idx', '2M');
- IF v('P7_A_ID') IS NOT NULL THEN
- l_query:=
- 'select
- A_ID,
- AGENCY_NAME,
- AGENCY_DESCRIPTION
- from AGENCIES
- where A_ID = '|| v('P7_A_ID') ||'';
- IF v('P7_REPORT_SEARCH') IS NOT NULL THEN
- l_query := l_query||' '||'
- and
- CONTAINS(agency_description, ''fuzzy('|| v('P7_REPORT_SEARCH') ||', 50, 100, weight), relevance'', 1) > 0;
- ';
- END IF;
- ELSE
- l_query:=
- 'select
- A_ID,
- AGENCY_NAME,
- AGENCY_DESCRIPTION
- from AGENCIES ';
- IF v('P7_REPORT_SEARCH') IS NOT NULL THEN
- l_query := l_query||' '||'
- where
- CONTAINS(agency_description, ''fuzzy('|| v('P7_REPORT_SEARCH') ||', 50, 100, weight), relevance'', 1) > 0;
- ';
- END IF;
- END IF;
- -- test and debug only
- htp.p( l_query );
- htp.p( '<br>' );
- RETURN l_query;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement