MATCHES and complex queries

I get an error message when trying to
execute the instructions bellow
create table publications
public_id number,
title varchar2(200),
constraint publications_pk
primary key(public_id)
create table profiles
profile_id number,
rule varchar2(500),
constraint pro_pk
primary key(profile_id)
I create a ctxrule index
create index profile_index on profiles(rule)
indextype is CTXSYS.CTXRULE;
I issue queries like this one
select profile_id from profiles
where (matches(rule,' etc .. ')>0)
or (title_rule is NULL)
or like this
select profile_id from profiles
where (matches(rule,' etc .. ')>0)
and (profile_id<10)
and get the error
ERROR at line 1:
ORA-20000: Oracle Text error:
DRG-50610: internal error: MATCHES does not support Functional Invocation

Actually the error only happens when this query
is issued inside a cursor loop and a stored procedure
like this one
create or replace procedure match(doc_num in number) as
document publications%rowtype;
begin
select * into document
from publications
where public_id=doc_num;
for matched_profile in (
select profile_id from profiles
where (matches(rule,document.title)>0)
and (profile_id<10)
loop
/*Other Code to type the matched profile*/
end loop;
end;
The code is syntactically correct
but causes runtime error.
The version of Oracle is use is 9.2.0.1

Similar Messages

  • Differentiate between Simple, Medium and Complex Queries.

    Hi Gurus,
    I am a Tech. Architect on this new project. I would like to know how to differentiate between Simple, Medium and Complex Queries in BW because I need this info to work on the Estimates. Has this differentiation got anything to do with the Backend config also?
    Thanks in Advance.
    Chandu.

    Hi
    You need to understand the requirements and consider the following before you classify........
    1) Queries that are based on multiple key figures--which may result in cell definition.
    2) Queries with complex calculations.
    3) Queries that are based on Variable Exits
    Regards
    Srinivas Bandi

  • Best Practices for Batch Updates, Inserts and Complex Queries

    The approach we have taken for our ALDSP Architecture is to model or DASi as Business Data Objects, each DS joining several (some times many) tables and lookups. This works ok when needing to access individual records for read and update, but when we need to update multiple tables and rows within the same commit, trying to do this with a logical single ds built on tables or other dASi, proves both cumbersome and slow. This is also the case for queries, when we have complex where clauses within a DS built upon two or more multi-table-joined logical DASi.
    We tried a DS built on SQL, but that does not allow dml operations. We may have to just use JDBC. Any thoughts on how best to leverage DAS in this respect.

    I tried doing this by creating a UO class and using it on a DS built on a sql statement. What we wanted to do here is first read the DS to get a list of ID values that met the conditions of the query and then call submit() and have the UO update all the necessary tables associated with those IDS.
    However, we found that U/O never get's called unless you actually update something, not just send submit() after a read. Dis I misunderstand the way this shoudl work?

  • REF partitioning is affecting on complex queries

    Hi,
    I am having 7 tables consider A,B,C,D,E,F,G. whereas A is master table and others are dependent on table A. columnA is referential key for all tables. Table A is having one DateRange column.
    I have successfully created range partitioning with partitioning key is DateRange. and Refeernce partitioning on other tables with column referring to ColumnA with foreign key.
    Also created local indexes on partitioned key DateRange.
    Problem is that, while fetching complex queries for reports, it is taking more time as compared to non partitioning structure. Is ref partitioning affecting on complex queries, queries returning more rows ??? Please suggest me about it.
    Thanks,
    Avinash.

    Did I miss anything ?Depends on what you've read about it sofar and why you decided to implement it.
    http://www.oracle-base.com/articles/11g/partitioning-enhancements-11gr1.php#reference_partitioning
    "The following conditions and restrictions apply to reference partitioning:
    The child table must specify a referential integrity constraint defined on the table being created. This constraint must be in ENABLE VALIDATE NOT DEFERRABLE state (the default) and refer to a primary or unique key on the parent table.
    The foreign key columns referenced in constraint must be NOT NULL.
    The constraint cannot use the ON DELETE SET NULL clause.
    The parent table referenced must be an existing partitioned table. All partitioning methods except interval partitioning are supported.
    The foreign key cannot contain any virtual columns.
    The referenced primary key or unique constraint on the parent table cannot contain any virtual columns.
    Reference partitioning cannot be used for index-organized tables, external tables, or domain index storage tables.
    A chain of reference partitioned tables can be created, but constraint used can't be self-referencing.
    The ROW MOVEMENT setting for both tables must match.
    Reference partitioning cannot be specified in a CREATE TABLE ... AS SELECT statement."

  • OBIEE generates complex queries

    Hi,
    Currently we are experiencing performance issues, i.e. some queries are running for a very long time. I examined these queries and it struck me that it could be caused by the complexity of the generated queries. For example, a query accessing only one facttable accessed that facttable 5 times (the queries are concatenated through the WITH statement) ! I wonder, why is this necessary? Business Objects XI does not generate such complex queries, BO XI would access that facttable only one time.
    Basically my question is: which settings affect the queries generated by OBIEE? Isn't it possible to generate different, simpler queries?
    TIA,
    EriK

    Thanks guys. Bad design could be a reason.. but we're using Oracle's own product called BI-APPS and I expect that to be perfect...:-)
    Here is an example of a query that is imho way too complex:
    WITH
    SAWITH0 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH1 AS (select distinct SAWITH0.c2 as c1,
    SAWITH0.c3 as c2,
    SAWITH0.c1 as c3,
    SAWITH0.c1 as c4,
    SAWITH0.c1 as c5
    from
    SAWITH0),
    SAWITH2 AS (select distinct SAWITH1.c1 as c1,
    SAWITH1.c2 as c2,
    SAWITH1.c3 as c3
    from
    SAWITH1),
    SAWITH3 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH4 AS (select distinct SAWITH3.c2 as c1,
    SAWITH3.c3 as c2,
    SAWITH3.c1 as c3,
    SAWITH3.c1 as c4,
    SAWITH3.c1 as c5
    from
    SAWITH3),
    SAWITH5 AS (select sum(SAWITH4.c4) as c4,
    SAWITH4.c1 as c5
    from
    SAWITH4
    group by SAWITH4.c1),
    SAWITH6 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH7 AS (select distinct SAWITH6.c2 as c1,
    SAWITH6.c3 as c2,
    SAWITH6.c1 as c3,
    SAWITH6.c1 as c4,
    SAWITH6.c1 as c5
    from
    SAWITH6),
    SAWITH8 AS (select sum(SAWITH7.c5) as c3
    from
    SAWITH7)
    select SAWITH2.c1 as c1,
    SAWITH2.c2 as c2,
    SAWITH2.c3 as c3,
    SAWITH5.c4 as c4,
    SAWITH8.c3 as c5
    from
    SAWITH2,
    SAWITH5,
    SAWITH8
    where ( nvl(SAWITH2.c1 , 'q') = nvl(SAWITH5.c5 , 'q') and nvl(SAWITH2.c1 , 'z') = nvl(SAWITH5.c5 , 'z') )
    Basically the query is:
    select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER
    but this query is repeated multiple times. It looks like a self join - but why is OBIEE generating such a complex query? And can it be affected?
    Edited by: user10984315 on 18-Mar-2011 08:29
    Edited by: user10984315 on 18-Mar-2011 08:30

  • After I run a query can I get it to return the number of files matched and each individual file name?

    After I run a query can I get it to return the number of files matched and each individual file name?  I am trying to do a data mining routine and this would be helpful. 
    BBANACKI

    Hi bbanacki,
    Please have a look at the following code:
    Define your queries and then:
    oAdvancedQuery.ReturnType=eSearchFile
    oMyDataFinder.Results.MaxCount = iMaxNumberOfReturndElements
    Call oMyDataFinder.Search(oAdvancedQuery)
    Set oMyResults  = oMyDataFinder.Results
    If oMyResults.IsIncomplete Then
      msgbox "The first " & str(oMyResults.Count) & " files found"
    Else
      msgbox str(oMyResults.Count) & "  files found"
    End If
    for iLoop = 1 to oMyResults.Count
      Cell.Text = oMyResults(iLoop).Properties("Name").Value
      Cell.Text = oMyResults(iLoop).Properties("fullpath").Value
    next
    Greetings
    Walter

  • Please some one can explain about some complex queries

    BW Guru's,
    please some one can explain about some complex queries which was created while working on Reporting.
    I need to create profit and loss query as per requirment on the FL-Gl cube.
    Answer would be appreciate in advance.
    Regards
    Krish

    HI Aryan,
    No need to create FM on your own. You can copy the FM from Function Group RSAX.
    The procedure to create FM extractor is as follows:
    1) Create an extract structure.
    2) Go to SE80. Select Function Group RSAX , right click and then copy.
    3) Give your own name to the function group to copy.
    4) Select one appropriate FM from the list of FMs provided. eg FM RSAX_BIW_GET_DATA_SIMPLE.
    5)Specify the name of new FM you want to create.
    6) Go to SE37 and open the FM you have created by copying from Function Group RSAX.
    7) no need to change the import tab.
    8) On tables tab, for paramerter name E_T_DATA under asociate name specify the name of extract structure you hav created.
    9) Under source code tab make the changes in the source code only to customise it to your requirement. eg: declare the database table you are using, make changes where datasource is in picture, etc.
    I have created a generic DataSource with the help of above procedure.. I hope you will find it helpful...
    Regards,
    Geetanjali

  • IMPLEMENTING PAGEWISE CONCEPT FOR COMPLEX QUERIES FOR WEB BASED TECHNOLOGIES

    Dear Friends
    how do i implement Page Wise concept for complex queries. Complex queries includes 'Group by', 'from selects'. Mere Rownum selection doesnt solve my problem. I have 3 buttons 'Previous', 'Next' and 'display of No. of records' . Kindly suggest me with a solution.

    The only widespread way is dynamically bild a SQL clause then parse and execute it using dynamic sql (package dbms_sql) or native dynamic sql (execute immediate clause).
    You can go through your already built cursor and display only those records you need (for example from 10th to 20th). I think there is no way to leave cursor open and reuse it another time. Every time You hit next, back or count button you need build new cursor (either selecting context columns to show some records or selecting count(*) to show number of records). You can generate this code with Oracle Designer, making webserver modules. Of course this will cost rather many $$$. Another tip - Designer makes this code for all situations and therefore it is somewhat difficult to understand it in the beginning. If you really need some example I can send something to you.

  • Documenting complex queries

    I'd like to start providing better documentation along with the database objects I produce. What's the best way to document what's going on in complex queries? I've started trying out different techniques of documenting source/target in a spreadsheet, but it seems to be lacking. I was wondering what others do? Any suggestions or references you could point me to? I could probably improve upon my inline comment practices, so any suggestions there are also welcome. Thanks

    I’ve encountered the problem before and got some good advice here: Re: Documentation help:  Procedural logic Vs Set logic
    Because SQL is an explicit language, and programmers being in the mental state that they are when programming, it’s difficult for us to deconstruct our perfectly explicit, self-documenting SQL statement into something that someone else will understand.
    The diagram linked in the above forum thread is an example where to explain what I’m doing, I’ve had to change the set-based logic of the SQL statement into a procedural loop type explanation. I hated doing this, but it was the best way I could think of to explain it to someone.
    More recently I’ve had to document a query that is fairly simple logically (to me anyway) but due to the number of tables and the fact that the audience doesn’t necessarily understand spatial queries, I found it easier to break it down using the following diagram:
    http://img.photobucket.com/albums/v115/whitehat/work%20related/query1.jpg
    tables probably won’t mean anything to you, but you can see how I’ve broken it down into business-logic “Retrieve criteria for exception checking”, “select providers”, “restrict providers” etc. the arrows represent the join criteria and the boxes split up the driving tables and the restriction tables.
    I’ve found this particular diagram very useful as part of the current project that I’m involved with. Even the System Testers are relying on this diagram to direct them in how everything fits together.
    Each situation is different however and you’ll just have to experiment with each bit of code as it comes along.
    Hope this helps!

  • Want complex queries

    Hi,
    Where can i find the SQL queries(unsolved) through which i can learn to write complex queries...
    As I am a novice programmer it would be better if the range varies from easy to complex ones.
    Thanks in advance.
    Mythili

    Actually for me a skill full SQL developer is one who can solve a complex problem with a simple SQL. Not the one who can write complex SQL ;)
    Some of the places from where i learn new and exiting stuff ever day are
    [Asktom.oracl.com |http://asktom.oracle.com/pls/asktom/f?p=100:1:146758316283624]
    [forums.oracle.com|http://forums.oracle.com/forums/main.jspa?categoryID=84]
    [Richard footes oracle blog|http://richardfoote.wordpress.com/]
    [Oracle Document is always there|http://tahiti.oracle.com/]
    These places are not going to make you a great SQL Developer in a day. You have to be there and keep learning constantly. Without your knowledge over a period of time your approach towards SQL will change. And change is good ;)

  • More complex queries ???

    hi all,
    Can you tell me anyone, where can I found more complex queries for oracle sql expert exam ?
    thx in advance

    Hi Christopher,
    have you checked out chapter 20 of the BPEL developers guide, at otn.oracle.com/bpel?
    It covers the dbadapter. Also we have many samples with the install, check out samples/tutorials/122.DBAdapter/PureSQLSelect.
    The most advanced solution, if you know TopLink well enough, is to use descriptor ammendment to express any complex sql using TopLink's proprietary expression API. Your ammendment class is written in java and must be on the appserver's classpath. You could check out the toplink otn forum for more info about that.
    Thanks
    Steve

  • Complex Queries.

    Hi Gang,
    I was in an interview last week and was asked to give an example of a complex queries I have worked with. I was really cought off guard and could not give a very intelligent answer other than mumbling. Can someone please help me out with real life examples? May be I will be asked the same in my next interview.
    Thanks,
    Kara.

    There are many features available in BEx querying, I would think that being able to discuss how / why you used some of them in the same query is what they are looking for, e.g. 
    - Creating RKFs with restrictions on several characteristics
    - Using variable offsetsto get KFs form different time periods
    - A case where using Constant Selection was needed.
    - Using some of the various totaling options.
    - Use of MultiProvider that includes Cube, ODS, and Master Data.
    Now if you haven't actually designed any quereis, this can be a challenge........

  • Complex Queries Developed in Desktop for Plus Users

    I develop complex queries in Discoverer desktop, with complex calculations and conditions and customized report formats. I understand that my "Plus" users can run them all. Is that correct?
    What about my "Viewer" users?

    Hi,
    The "Viewers" users can run any complex report, equally like "Plus". The reports would have to be shared with the Viewers users.
    Discoverer desktop is a client side development tool and Plus is the "Equivalent" web version. So complex calculations/conditions should not affect.
    Thanks.

  • Complex queries in Open SQL

    Moved to performance forum by moderator
    Hi Experts,
    This is more of a discussion rather than a question. I would like to know the advantages of Open SQL. It prevents you from writing complex queries, the kind of queries that you can write in native sql.
    The biggest disadvantage I feel is that you have to fetch data into internal tables and loop. This takes a lot of processing time when you have a report having a lot of lines. A complex query using complex joins and subqueries will always perform better than having to loop and process data and simple things like generating sequence.
    The best thing about open sql is the way it handles select options.
    I would like to get your opinions and suggestions how to write complex queries in ABAP with some code snippets if possible.
    Warm Regards,
    Abdullah
    Edited by: Matt on Jan 21, 2009 6:54 PM

    > select - endselect will query the database repeatedly and wont be any different from using a loop on
    > internal table.
    that is a  very common misunderstanding, but not true, it uses the arry interface, but gives you the possibility to react on every line. But interaction with DB is in blocks.
    The biggest advantage of Open SQL is the implementation of the table buffer, every Open SQL Statement checks the buffers first.
    Other advantage, all statements changing table definitions are not allowed.
    And of course, as already said, it is a set of commands available on all DB platforms certified for SAP software, i.e. IBM, Oracle, Max DB and Microsoft.
    Complex queries, even with the available joins you can write very very complex queries ... sometimes too complex. I see not advantage for a competetion of writing the most complex statement
    Siegfried

  • No matching records found 'Queries' (OUQR) (ODBC-2028) [Message 138-183]

    Hello All
    I have created a SAP Business One addon in which I have created so many User menus Under 'Administration' , ' Sales A/R', 'Purchasing A/R' and New menu item under 'Modules'. All my program and menus are working fine. But after a certain time of period, when I press any of these menus, I am getting a SAP Status bar error message (RED) that 'No matching records found 'Queries' (OUQR) (ODBC-2028) [Message 138-183]'. Even after the menus are working fine. But I am receiveing this constantly.
    I am getting this message even after closing my addon program. So I think this message is coming from SAP itself.
    Any clue regarding this?
    Anoop

    Hi Anoop.....
    I guess any of the queries has been removed from Query manager which is applied to the Marketing Docs as FMS......
    Please check properly......
    Regards,
    Rahul

Maybe you are looking for

  • How many computers can I install Logic Express on?

    Simple question...can I buy one copy of Logic Express and install it on both my Macbook Pro and my new iMac when I get it? I can't see anywhere on Apple's site any info on the software product licences. I also need to know the same information for Fi

  • Preserving aspect ratio 16:9

    I've placed several Flash videos on a Web site, all 4:3 standard definition. All look fine. I have one video that's 16:9 widescreen high-definition. When I try to place it on the same site (using the same HTML snippet code as the others), much of the

  • Bt Infinity 80/20

    I got Infinity 80/20 at the end of June. For the first 3 weeks i had a rock solid 50/15 actual service with very low single figure pings to test servers. After the first 3 weeks the service became "variable" to say the least. The down speed wanders a

  • Getting the count of DISTINCT of several columns

    How can i get the count of DISTINCT of several columns? SQL> select count(distinct ename) from emp; COUNT(DISTINCTENAME)                   14 SQL> select count(distinct ename, job) from emp; select count(distinct ename, job) from emp ERROR at line 1:

  • 9i Installation

    I have followed all the steps as mentioned in the download page of the website. The setup starts but somehow doesnt not proceed after 85%. Processing Oracle Database Configuration Assistant. is the message i get on top of the progress bar. But Nothin