Can I fire CONTAINS Query on BFILE

Hi friends,
I am trying to use BFILE in my application to store the txt and doc file . I created the table set the directory and granted the permission as well as created the index till now all smooth, however when i fire CONTAINS query it does not give me any result. It does not show any error but it is not fetching me the results as well ..
Following are the steps :
CREATE TABLE my_doc ( id NUMBER, file_name VARCHAR2(255), upload_date VARCHAR2(10), filesize VARCHAR2(20), mime VARCHAR2(50),
content BFILE, CONSTRAINT doc_pk PRIMARY KEY (id));
CREATE OR REPLACE DIRECTORY documents AS '/usr/local/Test';
grant
CREATE INDEX my_doc_idx ON my_doc(content) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('SYNC ( ON COMMIT)');
INSERT INTO my_doc values(100, 'TestFile', '123','25', 'mime', BFILENAME('DOKUMENTE','New Text Document.txt'));
INSERT INTO my_doc values(10, 'TestFile', '123','25', 'mime', BFILENAME('DOKUMENTE','Document.txt'));
SELECT SCORE(1), file_name, filesize FROM my_doc WHERE CONTAINS(content,'INDEX', 1) > 0 ;
SELECT SCORE(1), file_name, filesize FROM my_doc WHERE CONTAINS(content,'%I%', 1) > 0 ;
Final TWO queries not showing any output
Please help !!!!!!!

Did you re-sync the index after the insert?

Similar Messages

  • How can I make CONTAINS query work for a date range

    In either 9i or 10g (eventual). I have a CONTEXT index that contains multiple columns from multiple tables and using a USER_DATASTORE. E.g., I have names that come from 3 different table locations and dates that come from 4. I can index them fine but how can I perform a single consolidated CONTAINS query against the single CONTEXT index to do the following:
    smith WITHIN lname AND john WITHIN fname AND dob BETWEEN '19870315' and '19970315'
    I know that I can use a mixed query but this is inefficient (esp since I have birth dates in multiple tables). Is there any algorithm for a range operator (>, <, between?) within the CONTAINS operator?
    CTXCAT index is not an option, as I have many text columns I am searching.
    Thanks!

    When you run the cdstore.sql, in addition to creating the ctx_cd package, it also creates the friedman package that contains the algorithm that the ctx_cd package uses. You could use the functions from that friedman package in your procedure for your user_datastore and in the creation of your query string, as demonstrated below.
    SCOTT@orcl_11g> CREATE OR REPLACE PROCEDURE my_proc
      2    (p_rowid IN           ROWID,
      3       p_clob     IN OUT NOCOPY CLOB)
      4  AS
      5  BEGIN
      6    FOR r IN
      7        (SELECT emp.ename, emp.job, emp.hiredate, dept.dname
      8         FROM      emp, dept
      9         WHERE  emp.deptno = dept.deptno
    10         AND      emp.ROWID = p_rowid)
    11    LOOP
    12        DBMS_LOB.WRITEAPPEND (p_clob, 7, '<ename>');
    13        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r.ename), r.ename);
    14        DBMS_LOB.WRITEAPPEND (p_clob, 8, '</ename>');
    15        DBMS_LOB.WRITEAPPEND (p_clob, 5, '<job>');
    16        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r.job), r.job);
    17        DBMS_LOB.WRITEAPPEND (p_clob, 6, '</job>');
    18        DBMS_LOB.WRITEAPPEND (p_clob, 7, '<dname>');
    19        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r.dname), r.dname);
    20        DBMS_LOB.WRITEAPPEND (p_clob, 8, '</dname>');
    21        DBMS_LOB.WRITEAPPEND (p_clob, 10, '<hiredate>');
    22        -- apply friedman algorithm to date column ------------------
    23        friedman.init
    24          (TO_NUMBER (TO_CHAR (TO_DATE (19000101, 'YYYYMMDD'), 'J')),
    25           TO_NUMBER (TO_CHAR (TO_DATE (21001231, 'YYYYMMDD'), 'J')));
    26        DBMS_LOB.WRITEAPPEND
    27          (p_clob,
    28           LENGTH (friedman.encodedate (r.hiredate)),
    29           friedman.encodedate (r.hiredate));
    30        --------------------------------------------------------------
    31        DBMS_LOB.WRITEAPPEND (p_clob, 11, '</hiredate>');
    32    END LOOP;
    33  END my_proc;
    34  /
    Procedure created.
    SCOTT@orcl_11g> SHOW ERRORS
    No errors.
    SCOTT@orcl_11g> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('my_datastore', 'USER_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE      ('my_datastore', 'PROCEDURE', 'my_proc');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> CREATE INDEX my_index ON emp (ename)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS
      4    ('DATASTORE     my_datastore
      5        SECTION GROUP CTXSYS.AUTO_SECTION_GROUP')
      6  /
    Index created.
    SCOTT@orcl_11g> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'DEPT')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'EMP')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> VARIABLE cstring VARCHAR2(4000)
    SCOTT@orcl_11g> BEGIN
      2    :cstring := 'smith WITHIN ename';
      3    :cstring := :cstring || ' AND ' || 'clerk WITHIN job';
      4    :cstring := :cstring || ' AND ' || 'research WITHIN dname';
      5    -- apply friedman algorithm to search criteria ---------------------------
      6    friedman.init
      7        (TO_NUMBER (TO_CHAR (TO_DATE (19000101, 'YYYYMMDD'), 'J')),
      8         TO_NUMBER (TO_CHAR (TO_DATE (21001231, 'YYYYMMDD'), 'J')));
      9    :cstring := :cstring || ' AND ((' ||
    10               friedman.integercontainscriteria
    11                 (TO_NUMBER (TO_CHAR (TO_DATE ('19800315', 'YYYYMMDD'), 'J')),
    12                  TO_NUMBER (TO_CHAR (TO_DATE ('19810315', 'YYYYMMDD'), 'J')),
    13                  'B')
    14               || ') WITHIN hiredate)';
    15    ---------------------------------------------------------------------------
    16  END;
    17  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11g> SELECT *
      2  FROM   emp
      3  WHERE  CONTAINS (ename, :cstring) > 0
      4  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
    Execution Plan
    Plan hash value: 1887222286
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    37 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP      |     1 |    37 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | MY_INDEX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("ENAME",:CSTRING)>0)
    SCOTT@orcl_11g>

  • Can i fire a query in Portal to get the portal records..?

    Epertz -
         I am currently working on Portal and stuck at one point. I have extracted some data from Portal and now i want to verify those data. My concern is  "Is there any editor or somthing where i can place my query and get the record in SAP Enterprise Portal or the way out to get  any report which provides me  users list or roles list which i can use it to compare with my initially extracted data..?
    Guys help me out...
    Thanks,
    Abhishek-

    Hi Abhishek,
    Please refer following wiki links:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=2791
    http://wiki.sdn.sap.com/wiki/display/EP/CreatinganewadministratoruserusingJSP
    http://wiki.sdn.sap.com/wiki/display/VC/getRolesForUser
    http://wiki.sdn.sap.com/wiki/display/VC/getAllPortalRoles+Webservice
    http://wiki.sdn.sap.com/wiki/display/Snippets/ExcelspreadsheetofUMEassignment+data
    Thanks & Regards,
    Shrikant

  • Can we write select query regardless of case sensitivity?

    Hello Everyone,
    I have written one function module. And in this FM i am using one import parameter which has Data element and domain as type. In that i have checked Upper/Lower case checkbox, to retain case of the data in table. But when firing query to database i have to supply same case as it is stored in table.
    so, can i ignore the case of the parameter in select query and can i fire the query regardless of the case of the where conition??
    Thanks in Advance,
    Bhavik

    Hi Bhavik,
    You can do this without adding a column to the table.
    Just Fetch all the data in one internal table then loop that table inside that loop check whether that field contains that string or not. For this you use CP operator, that checks for string irrespective of the case. This can perform wild serach also. The following code may help you,
        SELECT * FROM /cpd/d_mp_hdr_s INTO TABLE it_mast_hdr_desc1.
        LOOP AT it_mast_hdr_desc1 INTO wa_mast_hdr_desc.
          IF wa_mast_hdr_desc-text CP lv_mp_text.
            APPEND wa_mast_hdr_desc TO it_mast_hdr_desc.
            CLEAR wa_mast_hdr_desc.
          ENDIF.
        ENDLOOP.
    Here both the internal table and the work area are of type /cpd/d_mp_hdr_s.
    Hope this helps you.
    With Regards,
    Ajeet Pratap Singh

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • Issue in executing contains Query(Oracle 11g Enterprise E on Linux RHEL 4

    Oracle Version: 11.1.0.6.0
    We are facing problem in executing contains Query :
    1.When length of string inside contains clause goes beyond 4000 it gives error ORA-01704: string literal too long
    2.We try to modify query by breaking it into multiple contains clause but it was not giving good performance (performance degrades as number of contains clauses increases.)It seems accessing same index multiple times becoming costly and taking more time. (We can see same domain Index has been accessed 3 times for 3 contains clause ()
    3.We used multiple varchar(4000) type bind variable in single contains clause but giving error
         ORA-29902: error in executing ODCIIndexStart() routine
         ORA-01489: result of string concatenation is too long
    4.We used bind variable of type clob but giving error
    Error:
    ORA-29902: error in executing ODCIIndexStart() routine
         ORA-20000: Oracle Text error:
         DRG-50857: oracle error in drexrstart_clob
    I read from article
    http://www.oracle.com/technology/products/text/pdf/ot11g_new_features.pdf
    That we don’t need to modified query as we had to do with SDATA(as we are doing in above examples) and optimizer will realize that query can be satisfied by the text index and will “push down” the filtering of rows into the text index processor rather than doing table access for filtering on sdata column but when I tried to write that query it was doing table access to filter for filter by column.
    My Questions:
    a.     Is it possible as mentioned in above point(point number 5) that we don’t need to write SDATA query in contains clause and optimizer will use composite index automatically.
    b.     Is there any workaround for using string literal > 4000 char in contains clause.
    c.     Why performance degrades lineally when using multiple contains clause.
    d.     Can we use in clause in SDATA and write query like this:
    i.     SDATA(queryid in ( 'q1',’q2’))
    /* Table */
    create table ContentStore (ResourceID raw(16), QueryID VARCHAR2(38),IFID VARCHAR2(38),ISTimeStamp number,ISProtocolName VARCHAR2(100),ismimecontenttype varchar2(100),ISToBeDisplayed number(1),IndexedMetaText CLOB)
    /* Index */
    create index idxMeta on ContentStore (IndexedMetaText) indextype is ctxsys.context filter by queryid,IFID,istimestamp,isprotocolname,ismimecontenttype,resourceid,istobedisplayed order by istimestamp desc parameters('filter ctxsys.null_filter section group GRP_system2 sync(every "sysdate+1/(24*4)" MEMORY 209715200 PARALLEL 2) storage my_text_storage memory 209715200')parallel 2
    /* GRP_system2*/
    begin
    ctx_ddl.create_section_group('GRP_system2', 'BASIC_SECTION_GROUP');
    ctx_ddl.add_field_section('GRP_system2', 'FILENAME', 'FILENAME');
    ctx_ddl.add_field_section('GRP_system2', 'ISIPSrcIP', 'ISIPSrcIP');
    ctx_ddl.add_field_section('GRP_system2', 'ISProxyUserIP', 'ISProxyUserIP');
    ctx_ddl.add_field_section('GRP_system2', 'isipdestip', 'isipdestip');
    end;
    /* 1.When length of string inside contains clause goes beyond 4000 it gives
         error ORA-01704: string literal too long */
    select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''c7d7fdb3-e532-42f1-a8b4-450771fc763f'')) or (sdata(queryid = ''7746f95a-01ba-4318-991a-35c2a8a0c73d'')) or (sdata(queryid = ''b0d339d2-ada9-485b-b752-79920a589340'')) or (sdata(queryid = ''33083cc8-7ed0-4a67-81f0-de1f3d673db2'')) or (sdata(queryid = ''0475dea9-288b-4be6-815e-751c98c25f2b'')) or (sdata(queryid = ''8cfb62f4-2bac-4da6-a2c2-84e409f5a810'')) or (sdata(queryid = ''afbf17a7-4170-45f4-9b66-de3860de93d7'')) or (sdata(queryid = ''750a7b1c-db61-4f87-b78f-505bc73aa5df'')) or (sdata(queryid = ''debc06f3-51a8-4278-9d38-f316dfb6340c'')) or (sdata(queryid = ''d2d8d8a8-b691-439f-b6de-618825aad152'')) or (sdata(queryid = ''f6a3515a-4c7b-48d0-8d46-f62541525cd0'')) or (sdata(queryid = ''bef5c527-5e78-494f-832c-12b3967f22cc'')) or (sdata(queryid = ''638a4029-c4bf-42ef-87bc-2cd4a3977dd1'')) or (sdata(queryid = ''1ce38c22-fd80-4d0f-b9ab-1a09941c5809'')) or (sdata(queryid = ''7bbbcc66-f19d-4758-bdd8-2796da1e26fe'')) or (sdata(queryid = ''d3e96050-ab5e-48b7-9445-d884167c8ae9'')) or (sdata(queryid = ''eaf93ce1-fbd8-4bb6-9fb1-12c337878c72'')) or (sdata(queryid = ''ef1ce7ce-9b4a-4f10-9c91-7256f513c709'')) or (sdata(queryid = ''46bf5cda-ada3-41f2-92b0-174ac29c5808'')) or (sdata(queryid = ''59136e92-147f-41c4-ac75-79d921268714'')) or (sdata(queryid = ''fb2382b2-6496-4c9f-a427-2f6db3b9fd16'')) or (sdata(queryid = ''531b3790-ed50-4b83-a0d0-eabfed2b6701'')) or (sdata(queryid = ''4908b148-2432-4041-947c-31ff8e10646c'')) or (sdata(queryid = ''82007d26-d526-42c9-a8d0-5b75e7f08b90'')) or (sdata(queryid = ''002735e8-6886-4bb4-a732-8a9d04165837'')) or (sdata(queryid = ''43f25cba-1d90-4cc2-84d1-a8719c5b1c9f'')) or (sdata(queryid = ''99d9027f-948b-4bc7-9a44-3092d6b29580'')) or (sdata(queryid = ''24221285-ea64-4e14-8c08-a173ec1b7fd9'')) or (sdata(queryid = ''47ad81d7-75cb-4787-91ab-c2bc5c5e1aaa'')) or (sdata(queryid = ''4ff2846f-6d70-4f9b-a5bf-317263c0ccc5'')) or (sdata(queryid = ''c1f5fbe7-72d1-499d-8d72-4aa21a79c97e'')) or (sdata(queryid = ''356f12c5-a769-478d-b57b-8a063be8ee8e'')) or (sdata(queryid = ''f6181853-2e16-4bce-88c0-6602bc853935'')) or (sdata(queryid = ''890f80e9-f3dd-4862-a55c-4f76569df360'')) or (sdata(queryid = ''5e9df138-8377-4841-92de-49bf6ed378a5'')) or (sdata(queryid = ''600b4dfd-e379-4754-8d06-873b593dbd14'')) or (sdata(queryid = ''af1476ac-3742-4272-bc97-584b1bbe3e2b'')) or (sdata(queryid = ''c2eb4e4c-2d09-4be8-b6ba-f1440349ed5a'')) or (sdata(queryid = ''2b819cdb-0941-48fd-8b93-dd1f661933b3'')) or (sdata(queryid = ''dfa094c9-c48c-4ca1-ad06-ead4f1a9d146'')) or (sdata(queryid = ''b1222061-acaf-4e85-80e1-00af07df962c'')) or (sdata(queryid = ''219b0c7b-266e-455b-b7ca-4f760976253c'')) or (sdata(queryid = ''2396f1e3-28f8-451b-a114-29390cec0cf3'')) or (sdata(queryid = ''c7d7fdb3-e532-42f1-a8b4-450771fc763f'')) or (sdata(queryid = ''7746f95a-01ba-4318-991a-35c2a8a0c73d'')) or (sdata(queryid = ''b0d339d2-ada9-485b-b752-79920a589340'')) or (sdata(queryid = ''33083cc8-7ed0-4a67-81f0-de1f3d673db2'')) or (sdata(queryid = ''0475dea9-288b-4be6-815e-751c98c25f2b'')) or (sdata(queryid = ''8cfb62f4-2bac-4da6-a2c2-84e409f5a810'')) or (sdata(queryid = ''afbf17a7-4170-45f4-9b66-de3860de93d7'')) or (sdata(queryid = ''750a7b1c-db61-4f87-b78f-505bc73aa5df'')) or (sdata(queryid = ''debc06f3-51a8-4278-9d38-f316dfb6340c'')) or (sdata(queryid = ''d2d8d8a8-b691-439f-b6de-618825aad152'')) or (sdata(queryid = ''f6a3515a-4c7b-48d0-8d46-f62541525cd0'')) or (sdata(queryid = ''bef5c527-5e78-494f-832c-12b3967f22cc'')) or (sdata(queryid = ''638a4029-c4bf-42ef-87bc-2cd4a3977dd1'')) or (sdata(queryid = ''1ce38c22-fd80-4d0f-b9ab-1a09941c5809'')) or (sdata(queryid = ''7bbbcc66-f19d-4758-bdd8-2796da1e26fe'')) or (sdata(queryid = ''d3e96050-ab5e-48b7-9445-d884167c8ae9'')) or (sdata(queryid = ''eaf93ce1-fbd8-4bb6-9fb1-12c337878c72'')) or (sdata(queryid = ''ef1ce7ce-9b4a-4f10-9c91-7256f513c709'')) or (sdata(queryid = ''46bf5cda-ada3-41f2-92b0-174ac29c5808'')) or (sdata(queryid = ''59136e92-147f-41c4-ac75-79d921268714'')) or (sdata(queryid = ''fb2382b2-6496-4c9f-a427-2f6db3b9fd16'')) or (sdata(queryid = ''531b3790-ed50-4b83-a0d0-eabfed2b6701'')) or (sdata(queryid = ''2396f1e3-28f8-451b-a114-29390cec0cf3''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    order by istimestamp desc ) where rownum <= 250)
    /* 2.We try to modify query by breaking it into multiple contains clause but it was not giving good performance (performance degrades as number of contains clauses increases.)
    Problem: - Performance of below query degrades linearly as number of contains clause for same column increases.
    Execution plan :
    It seems accessing same index multiple times becoming costly and taking more time. (We can see same domain Index has been accessed 3 times for 3 contains clause ()
    select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where
    contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''c7d7fdb3-e532-42f1-a8b4-450771fc763f'')) or (sdata(queryid = ''7746f95a-01ba-4318-991a-35c2a8a0c73d'')) or (sdata(queryid = ''b0d339d2-ada9-485b-b752-79920a589340'')) or (sdata(queryid = ''33083cc8-7ed0-4a67-81f0-de1f3d673db2'')) or (sdata(queryid = ''0475dea9-288b-4be6-815e-751c98c25f2b'')) or (sdata(queryid = ''8cfb62f4-2bac-4da6-a2c2-84e409f5a810'')) or (sdata(queryid = ''afbf17a7-4170-45f4-9b66-de3860de93d7'')) or (sdata(queryid = ''750a7b1c-db61-4f87-b78f-505bc73aa5df'')) or (sdata(queryid = ''debc06f3-51a8-4278-9d38-f316dfb6340c'')) or (sdata(queryid = ''d2d8d8a8-b691-439f-b6de-618825aad152'')) or (sdata(queryid = ''f6a3515a-4c7b-48d0-8d46-f62541525cd0'')) or (sdata(queryid = ''bef5c527-5e78-494f-832c-12b3967f22cc'')) or (sdata(queryid = ''638a4029-c4bf-42ef-87bc-2cd4a3977dd1'')) or (sdata(queryid = ''1ce38c22-fd80-4d0f-b9ab-1a09941c5809'')) or (sdata(queryid = ''7bbbcc66-f19d-4758-bdd8-2796da1e26fe'')) or (sdata(queryid = ''d3e96050-ab5e-48b7-9445-d884167c8ae9'')) or (sdata(queryid = ''eaf93ce1-fbd8-4bb6-9fb1-12c337878c72'')) or (sdata(queryid = ''ef1ce7ce-9b4a-4f10-9c91-7256f513c709'')) or (sdata(queryid = ''46bf5cda-ada3-41f2-92b0-174ac29c5808'')) or (sdata(queryid = ''59136e92-147f-41c4-ac75-79d921268714'')) or (sdata(queryid = ''fb2382b2-6496-4c9f-a427-2f6db3b9fd16'')) or (sdata(queryid = ''531b3790-ed50-4b83-a0d0-eabfed2b6701'')) or (sdata(queryid = ''4908b148-2432-4041-947c-31ff8e10646c'')) or (sdata(queryid = ''82007d26-d526-42c9-a8d0-5b75e7f08b90'')) or (sdata(queryid = ''002735e8-6886-4bb4-a732-8a9d04165837'')) or (sdata(queryid = ''43f25cba-1d90-4cc2-84d1-a8719c5b1c9f'')) or (sdata(queryid = ''99d9027f-948b-4bc7-9a44-3092d6b29580'')) or (sdata(queryid = ''24221285-ea64-4e14-8c08-a173ec1b7fd9'')) or (sdata(queryid = ''47ad81d7-75cb-4787-91ab-c2bc5c5e1aaa'')) or (sdata(queryid = ''4ff2846f-6d70-4f9b-a5bf-317263c0ccc5'')) or (sdata(queryid = ''c1f5fbe7-72d1-499d-8d72-4aa21a79c97e'')) or (sdata(queryid = ''356f12c5-a769-478d-b57b-8a063be8ee8e'')) or (sdata(queryid = ''f6181853-2e16-4bce-88c0-6602bc853935'')) or (sdata(queryid = ''890f80e9-f3dd-4862-a55c-4f76569df360'')) or (sdata(queryid = ''5e9df138-8377-4841-92de-49bf6ed378a5'')) or (sdata(queryid = ''600b4dfd-e379-4754-8d06-873b593dbd14'')) or (sdata(queryid = ''af1476ac-3742-4272-bc97-584b1bbe3e2b'')) or (sdata(queryid = ''c2eb4e4c-2d09-4be8-b6ba-f1440349ed5a'')) or (sdata(queryid = ''2b819cdb-0941-48fd-8b93-dd1f661933b3'')) or (sdata(queryid = ''dfa094c9-c48c-4ca1-ad06-ead4f1a9d146'')) or (sdata(queryid = ''b1222061-acaf-4e85-80e1-00af07df962c'')) or (sdata(queryid = ''219b0c7b-266e-455b-b7ca-4f760976253c'')) or (sdata(queryid = ''2396f1e3-28f8-451b-a114-29390cec0cf3''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    or
    contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''f22c0b85-2e72-4450-92b7-8f9864c2517a'')) or (sdata(queryid = ''dbc6111b-5fef-4925-93f0-ecf94aa2305b'')) or (sdata(queryid = ''5d737150-3c55-4582-8b2e-8039615b8e69'')) or (sdata(queryid = ''fc8bf42c-2c7a-4506-aa3a-89266ef09ceb'')) or (sdata(queryid = ''7d3f7561-ba99-49fd-9492-214d9f571831'')) or (sdata(queryid = ''73110ce8-6930-4044-90f7-9c5d27bc0b10'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or (sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or (sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or (sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or (sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or (sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or (sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or (sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or (sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or (sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or (sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or (sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or (sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or (sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982'')) or (sdata(queryid = ''e5f133c5-f8d3-4905-b4db-ceba89476e7d'')) or (sdata(queryid = ''27dd1a53-a158-46ea-b38d-31a57bd7154e'')) or (sdata(queryid = ''cc335826-5e5e-4d4c-9406-2050717bea5d'')) or (sdata(queryid = ''e1ca6d4d-0005-43ec-a121-5574b37231ec'')) or (sdata(queryid = ''4be550f1-8e0a-4748-8186-50228531751d'')) or (sdata(queryid = ''8637ff63-3d0d-4451-9e40-b890d197f6cd'')) or (sdata(queryid = ''5f664e9e-b72f-4ae7-b69d-081ab7873146'')) or (sdata(queryid = ''baecc6fb-e9cf-41df-9fa4-1793b510d474'')) or (sdata(queryid = ''fa27ba4c-4ab8-4bd0-8725-a03c4666dcde'')) or (sdata(queryid = ''918bfb52-7323-4046-b96a-4ef905687dbb'')) or (sdata(queryid = ''3faad930-81c6-421b-84aa-81a9cfdc2c8b'')) or (sdata(queryid = ''7dc5033d-3a27-4058-885a-d103e73328f2'')) or (sdata(queryid = ''8eb4a0ce-654b-42f0-a868-7f7fdb483a13'')) or (sdata(queryid = ''1b44713f-6cbf-4b49-b851-5a500b221c27'')) or (sdata(queryid = ''11febb09-9106-4b92-a43d-cb71696adc90'')) or (sdata(queryid = ''1d84ca10-375e-4e17-a1c0-03515e1cfe5b'')) or (sdata(queryid = ''9cf1f3fd-136c-4abb-8319-6f6c6ddc514c'')) or (sdata(queryid = ''24f5347a-ff20-4245-a4dc-eb2f8c918c91'')) or (sdata(queryid = ''2640ef3c-8a20-4f28-92df-0bc19b058d91'')) or (sdata(queryid = ''af3d0817-0d40-4adb-9655-a5460805a7eb'')) or (sdata(queryid = ''77b86c41-3afc-4c9c-9432-d7a1ee979af2'')) or (sdata(queryid = ''2a26f0d8-1162-4f34-be48-65b409abef28'')) or (sdata(queryid = ''649810b8-0d7b-47ab-8433-8e9bba88583d'')) or (sdata(queryid = ''c4f853ef-cd7c-436d-a16d-03d49681bee6'')) or (sdata(queryid = ''5c1896ce-06af-406c-bfbd-40d2349171bd'')) or (sdata(queryid = ''8d9fe822-f720-4ee5-a80d-552edd778f82'')) or (sdata(queryid = ''f30220c6-5638-47ec-ad98-4768ee299232'')) or (sdata(queryid = ''3faf5d0b-e3c0-4b68-8244-e07334c17326''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    or
    contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''c3662b10-98fc-453d-86e1-0c81fe3bb038'')) or (sdata(queryid = ''2b4e7f6e-7871-45eb-b046-bfd4f5d2d84c'')) or (sdata(queryid = ''5af44897-0bc9-4307-bcb1-7f07750e1e25'')) or (sdata(queryid = ''2b57feb3-1681-48db-9856-5d23d69de605'')) or (sdata(queryid = ''47c3939e-d46d-4c7f-9a42-305634642a72'')) or (sdata(queryid = ''476a04ad-6be3-459b-8ab1-6e270416add6'')) or (sdata(queryid = ''61be42b4-11d6-4ff9-a06d-e896690d7fd4'')) or (sdata(queryid = ''97a00e72-2e7d-4c02-b41b-d9d1601bc08c'')) or (sdata(queryid = ''8739fefa-c015-4912-999e-cd9524dffedb'')) or (sdata(queryid = ''61054068-5892-4aaf-ab31-9e6301de9808'')) or (sdata(queryid = ''741a5302-aadc-4bf2-bdcf-b41e95b49d05'')) or (sdata(queryid = ''c13d9ec0-2b18-4838-9bdb-ddb0686fd1d5'')) or (sdata(queryid = ''b02a2176-0ba5-47f4-843d-3d54e3faad77'')) or (sdata(queryid = ''451b906e-3a5c-4ed2-9d94-0a603e6ad94d'')) or (sdata(queryid = ''d1c767d7-cd0a-44c5-a8ff-ce5fa4522ece'')) or (sdata(queryid = ''ca71a03e-26c6-43f3-9755-a248ebaf35b5'')) or (sdata(queryid = ''d93777b8-f03b-49b0-94fc-8019b52c0637'')) or (sdata(queryid = ''e05ebc73-51cb-4112-b685-5104c4884020'')) or (sdata(queryid = ''a1b342c7-9ce0-4aa1-96e8-74621b34d411'')) or (sdata(queryid = ''bde5de4a-b1d4-4edd-9033-6bcba45fcfc2'')) or (sdata(queryid = ''1e345627-c639-4349-95d0-fdfe348935df'')) or (sdata(queryid = ''bd33b778-83c1-4610-a767-f8ce2ade5339'')) or (sdata(queryid = ''54eaa539-e50a-4e95-8d94-f7e95cf0f57b'')) or (sdata(queryid = ''3181ef7a-77cd-405f-9dfa-1c13444efb82'')) or (sdata(queryid = ''0a72bf53-c8ca-405f-9098-9383ed02815a'')) or (sdata(queryid = ''2fb2fff2-b240-46a6-99b8-00521b4325e4'')) or (sdata(queryid = ''5321fa18-a88d-45cb-b8d6-383180cb308b'')) or (sdata(queryid = ''f13bcfdf-d61f-4871-9c74-23ea58204cbb'')) or (sdata(queryid = ''eb5188da-3659-4e7a-b9e4-6985624c3867'')) or (sdata(queryid = ''1679a0ee-6fa7-4c5b-9e0f-09512bc6a74b'')) or (sdata(queryid = ''fd05f61b-5c63-4f99-975e-573ca0f68e8e'')) or (sdata(queryid = ''10802bc7-28bd-43d4-aa24-cf5f9cf6d19f'')) or (sdata(queryid = ''302dbebf-4edd-43a8-93e9-dd6faec8ff14'')) or (sdata(queryid = ''573020da-b5c1-489a-a7d9-eae363e535ef'')) or (sdata(queryid = ''ca514f9e-f4b9-42eb-a8b3-57a384e65540''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    order by istimestamp desc ) where rownum <= 250)
    /* 3.We used multiple varchar(4000) type bind variable in single contains clause but giving error
         ORA-29902: error in executing ODCIIndexStart() routine
         ORA-01489: result of string concatenation is too long
         variable querystring1 varchar2(4000);
    exec :querystring1 := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
    variable querystring2 varchar2(4000);
    exec :querystring2 := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
    variable querystring3 varchar2(4000);
    exec :querystring3 := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
         select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where contains(indexedmetatext,:querystring1|| ' or ' ||:querystring2|| ' or ' ||:querystring3) > 0 order by istimestamp desc ) where rownum <= 250);
    /* 4.We used bind variable of type clob but giving error
    Error:
    ORA-29902: error in executing ODCIIndexStart() routine
         ORA-20000: Oracle Text error:
         DRG-50857: oracle error in drexrstart_clob
    variable querystring CLOB;
    exec :querystring := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
    select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where contains(indexedmetatext,:querystring) > 0 order by istimestamp desc ) where rownum <= 250);
    /* 5.I read from article
    http://www.oracle.com/technology/products/text/pdf/ot11g_new_features.pdf
    That we don’t need to modified query as we had to do with SDATA(as we are doing in above examples) and optimizer will realize that query can be satisfied by the text index and will “push down” the filtering of rows into the text index processor rather than doing table access for filtering on sdata column but when I tried to write that query it was doing table access to filter for filter by column.
    /* 6.My Questions:
    a.     Is it possible as mentioned in above point(point number 5) that we don’t need to write SDATA query in contains clause and optimizer will use composite index automatically.
    b.     Is there any workaround for using string literal > 4000 char in contains clause.
    c.     Why performance degrades lineally when using multiple contains clause.
    d.     Can we use in clause in SDATA and write query like this:
    i.     SDATA(queryid in ( 'q1',’q2’))
    */

    SQE is really breakthrough for me but I dont know why it is not working in my case.I tried it onOracle 11g installaion with window and Linux both but did not get success.
    Please suggest me what I need to check when Installing if it is installation problem?
    My attempt:
    [oracle@oracle2 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jul 6 12:21:32 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create user test identified by test;
    User created.
    SQL> grant connect,dba,resource,ctxapp to test;
    Grant succeeded.
    SQL> connect test/test@content;
    Connected.
    SQL> create table test (text varchar2(2000));
    Table created.
    SQL> insert into test values ('hello world');
    1 row created.
    SQL> create index testindex on test(text) indextype is ctxsys.context;
    Index created.
    SQL> exec ctx_query.store_sqe('testsqe', 'hello')
    PL/SQL procedure successfully completed.
    SQL> select * from test where contains (text, 'sqe(testsqe)') > 0;
    select * from test where contains (text, 'sqe(testsqe)') > 0
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-00100: internal error, arguments : [50935],[drpn.c],[1051],[],[]
    ORA-01403: no data found
    SQL> select * from test where contains (text, 'ctx_query.sqe(testsqe)') > 0;
    no rows selected
    SQL>

  • Problem when using About Operator in Contains Query

    Hi,
    I'm new to Oracle and this forums too. I have a problem when using about operator in contains query.
    I create a table with some records and then create a context index on 'name' column.
    CREATE TABLE my_items (
      id           NUMBER(10)      NOT NULL,
      name         VARCHAR2(200)   NOT NULL,
      description  VARCHAR2(4000)  NOT NULL,
      price        NUMBER(7,2)     NOT NULL
    ALTER TABLE my_items ADD (
      CONSTRAINT my_items_pk PRIMARY KEY (id)
    CREATE SEQUENCE my_items_seq;
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Car', 'Car description', 1);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Train', 'Train description', 2);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Japan', 'Japan description', 3);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'China', 'China description', 4);
    COMMIT;
    EXEC ctx_ddl.create_preference('english_lexer','basic_lexer');
    EXEC ctx_ddl.set_attribute('english_lexer','index_themes','yes');
    EXEC ctx_ddl.set_attribute('english_lexer','theme_language','english');
    CREATE INDEX my_items_name_idx ON my_items(name) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('lexer english_lexer');
    EXEC ctx_ddl.sync_index('my_items_name_idx');Then I perform contains query to retrieve record :
    SELECT count(*) FROM my_items WHERE contains(name, 'Japan', 1) > 0;
    COUNT(*)
          1
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Japan)', 1) > 0;
    COUNT(*)
          1But the problem is when I using ABOUT operator like in Oracle's English Knowledge Base Category Hierarchy it return 0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Asia)', 1) > 0;
    COUNT(*)
          0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(transportation)', 1) > 0;
    COUNT(*)
          0I can't figure out what 's wrong in my query or in my index.
    Any help will be appreciated.
    Thanks,
    Hieu Nguyen
    Edited by: user2944391 on Jul 10, 2009 3:25 AM

    Hello (and welcome),
    You'd be best asking this question in the Oracle Text forum, here:
    Text
    And by the way, it will help others to analyse if you put {noformat}{noformat} (lowercase code in curly brackets) before and after your code snippets.
    Good luck!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to fire the query: "IsuOrderItemQuery"

    Hi Experts,
                          I am trying to fire the query "IsuOrderItemQuery" by giving the BUPA_NUMBER as the input value. For this I have used the method CL_CRM_BOL_QUERY_SERVICE->GET_QUERY_RESULT but i am not able to get the result and i am not able to get any child relations. When I look from BOL browser for the same orderitemquery by giving the BP it is working fine. Can anybody throw some light on this issue to read the childnodes by triggering the "IsuOrderItemQuey".
    Contributions will be highly rewared. Thanks
    Regards,
    Lakshmana.P

    ls_parameter  TYPE crmt_name_value_pair,
    lt_parameter  TYPE crmt_name_value_pair_tab,
    query_items   TYPE REF TO cl_crm_iu_order_item_query,
    col_items     TYPE REF TO if_bol_bo_col,
    TRY.
    CREATE OBJECT query_items
    EXPORTING
    iv_query_name = 'IsuOrderItemQuery'.
    CATCH cx_crm_unsupported_object.      "#EC NO_HANDLER
    ENDTRY.
    IF query_items IS BOUND.
    ls_parameter-name  = 'CA_NUMBER'.         "#EC NOTEXT
    ls_parameter-value = ''.
    APPEND ls_parameter TO lt_parameter.
    ls_parameter-name  = 'ISU_CONTRACT_NR'.         "#EC NOTEXT
    ls_parameter-value = '55000001'.
    APPEND ls_parameter TO lt_parameter.
    query_items->set_query_parameters( it_parameters = lt_parameter ).
    col_items = query_items->get_query_result( ).

  • ORA-01006 Using Bind Variables In A Dynamic SQL Contains Query

    I have the following dynamic SQL query :-
    declare
    TYPE typ_sql IS REF CURSOR;
    ltyp_sql typ_sql;
    lv_sql VARCHAR2(100);
    begin
    lv_sql := 'SELECT arx_id FROM arx WHERE CONTAINS ';
    lv_sql := lv_sql || (arx_full,''(:b1) WITHIN ui'') > 0';
    open ltyp_sql FOR v_sql USING ln_id;
    fetch ......
    close ......
    end;
    When the code tries to open the cursor it gives the above error. I presume it is the way Oracle is expanding the bind variable but I cannot find anything in the docs to say why this is happening or whether you can do this or not using bind variables ( CONTAINS query ). Any help would be appreciated, thanks,
    Stuart.

    lv_sql || '(arx_full, :b1 || '' within ui'') > 0';

  • How  to fire a query for every record in a table, pass values in a loop

    Hi,
    For each record in a table, I want to loop through each record and then fire a query by passing acct, product and date from this table to the where clause of the query. I would have to create a pl/sql block..The output of the query I want to spool from sql developer.
    I need the exact syntax please for doing this.. since i am new to Oracle. Just the template will be enough. I will fill in the query.
    Any help is appreciated as always..
    Regards,
    hena

    904385 wrote:
    Hi,
    For each record in a table, I want to loop through each record and then fire a query by passing acct, product and date from this table to the where clause of the query. I would have to create a pl/sql block..The output of the query I want to spool from sql developer.
    I need the exact syntax please for doing this.. since i am new to Oracle. Just the template will be enough. I will fill in the query.
    Any help is appreciated as always..
    Regards,
    henaHave you ever considered using a JOIN ? It does the same thing as looping through a table and applying that to the where clause of a select on a query, only much, much, much faster and without the need to write any code. SQL is a declarative language, so you specify what you want and not how to do it. It can be bit of a journey to change your thought process if you come from a procedural or object world, but once you get there it's a beautiful view.

  • Page not cached because "URL contains query string"

    I have used JDeveloper to produce a search/display page using ADF where the user enters search criteria and then presses a Search command button. The parameters are POSTed to the webserver, and I need to devise a cache rule to cache pages using the entered search criteria so that another seach for the same values can be served from the cache.
    I have created a rule that will cache GET, GET with Query String and POST.
    I have put .* in the POST body. When I do this, the first query page is retrieved from the origin server and cached and resulting queries with different search criteria are returned the data for that first search (ie. it's not taking into account the search parameters).
    If I switch off that rule and look at what's being received, I see the following:
    /158.234.27.10:8889/BM/faces/physical.jsp POST;;;event=&form1:selectOneChoice1=0&form1:selectOneChoice2=&form1:selectedDate=2004-08-10&form1:table1:rangeStart=0&form1:table2:rangeStart=0&form1:table3:rangeStart=0&form1:table4:rangeStart=0&form1:table5:rangeStart=0&form1:table6:rangeStart=0&oracle.adf.faces.FORM=form1&oracle.adf.faces.STATE_TOKEN=3&source=form1:commandButton1;;
    Now, there are 3 search parameter fields that need to be considered - the others should be ignored:
    form1:selectOneChoice1
    form1:selectOneChoice
    form1:selectedDate
    It's not clear to me where (and how - in what format) I specify parameters to ignore and parameters to consider. I have tried listing these 3 parameters in the URL parameters table for the Rule (I did not specify a value - should I have done?) but when I do this, the page is not cached and shows the reason for this is that "URL Contains Query String".
    Can someone explain how to specify important POST body parameters and unimportant POST body parameters?
    Thanks,
    Andy

    Hi,
    Please go through this:
    http://download-west.oracle.com/docs/cd/B14099_02/caching.1012/b14046/cache.htm#sthref1530
    Hope it helps you. I think you should be able to configure the intended rule in Web Cache.
    Regards,
    Priyanka GES

  • Contains query fails for extended ascii characters

    I have an Oracle 9.2 instance whose characterset is WE8MSWIN1252. I'm using the same characterset on my client. If I have a LONG column that contains extended-ascii characters (the example I'm using has the Euro character '€', but I've seen the same problem with other characters), and I'm using the Intermedia service to index that column, then this select statement returns no records even though it should find several:
    select id from table1 where (contains(long_col,'€',1) > 0);
    However, the same select statement looking for something else, like 'e', works just fine.
    What am I doing wrong? I can do a "like" query against a VARCHAR2 column with a Euro character, and it works correctly. I can do a "dbms_lob.instr" query against a CLOB column with a Euro character, and it also works. It's just the "contains" query against a LONG column that fails.

    There are a number of limitations in using Long datatypes. If you check the SQL Reference you will see: "Oracle Corporation strongly recommends that you convert LONG columns to LOB columns as soon as possible. Creation of new LONG columns is scheduled for desupport.
    LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases."

  • I can not find my query

    Dear everyone,
    I need to find a query.
    This query is contained in SE93 with transaction START_REPORT, below is the detail.
    D_SREPOVARI-REPORTTYPE = 'AQ'
    D_SREPOVARI-REPORT = 'FI'
    D_SREPOVARI-EXTDREPORT = Z_GRIR_VENDOR3
    I can't find this query in SQ01.
    Could you  tell me where i can find this query? Thank you very much.

    Hi Gautham,
    Thank you for your answer.
    I have got a result. Below is the result.
    WORKSPACE = ''
    USERGROUP = u2018FI'
    QUERY = 'Z_GRIR_VENDOR3'
    CLIENT = '888'
    Blew link is the image of SE93.
    [http://img.ph.126.net/sa03yj2WMcK_jbIanpImbg==/956733445839787441.bmp]
    But I can not find the usergroup 'FI' in SQ03.
    Of course can not find the query 'Z_GRIR_VENDOR3' too.
    Why?
    Edited by: Eric.Zheng on Nov 30, 2010 10:05 AM

  • What are attributes we can use in LDAP query in server derivation rules

    Q: What are attributes we can use in LDAP query in server derivation rules
    A: Server derivation rules can be defined for an LDAP server in the same way as that for a Radius server. As opposed to a Radius server, where the list of attributes that are defined for a server are standard, for an LDAP server, the attributes depend on the type of the server.
    The following table contains the list of attributes that are available for an Active Directory implementation. The server may maintain only a subset of these attributes, depending on how the user entries have been configured.
    Attribute Name:
    ==============
    sAMAccountname
    userPrincipalName
    givenName
    sn
    initials
    description
    physicalDeliveryOfficeName
    telephoneNumber
    mail
    wwwHomePage
    url
    logonHours
    logonWorkstation
    userAccountControl
    pwdLastSet
    userAccountControl
    accountExpires
    streetAddress
    postOfficeBox
    postalCode
    memberOf
    primaryGroupID
    title
    department
    company
    manager
    directReports
    profilePath
    scriptPath
    homeDrive
    homeDirectory
    HomeDirDrive
    telephoneNumber
    otherTelephone
    pager
    pagerOther
    mobile
    otherMobile
    fascimileTelephoneNumber
    otherFascimileTelephoneNumber
    ipPhone
    otherIpPhone

    >
    praveen.tecnics wrote:
    > hi experts
    >
    > what are mapping rules in sap xi/pi  ? how we can use this rules for special charters mapping .
    to map special characters you need to use an element called CDATA in your mapping
    a special character causes an error....as XI wont be able to read it (as it is not in a proper XML format)...so to parse this character through XI without causing an eror use the CDATA....just make a search on SDN and you will find the proper use of it....
    For your info: http://www.w3schools.com/XML/xml_cdata.asp
    Regards,
    Abhishek.
    Edited by: abhishek salvi on May 20, 2009 8:52 AM

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

Maybe you are looking for

  • HT201269 When upgrading (4s to 5s), is there a way to save old iMessages?

    I know old iMessages are normally deleted when you upgrade and iMessage is empty on the new phone, but is there a way to keep the old ones?

  • Reader 9.1 (Linux) left large temp files in user accounts

    We had one user who found himself way over his disk quota recently...upon further examination, it appears Reader 9.1 left some very large files in ~/.adobe/Acrobat/9.0/Temp What are the .tmp files created in this directory used for? John

  • Send email message without attaching form

    Below is a sample click event javascript for a button.  This will generate an email including form information of your choosing without attaching the actual form (PDF) itself. This would benefit people in situations that have the form auto saving to

  • Result set two few parameters exception!!?

    when i use the following code:        res = stat1.executeQuery("SELECT * FROM Word where word="+current ); where res is a result set stat1 is a statement current is a string the following exception appears after running: java.sql.sqlexception[microso

  • Restoring photos

    I recently downloaded the latest software and sync iphone to enable new photo paste with text feature. The Iphone locked up with the computer and I needed to restore. Tech support from apple corp. helped to get that done. Now I notice no photos made