Wrong result in match pattern

Hi, I want to extract the space (sometimes, !#" etc) from "@020 12345' using match pattern function.
When I used [\s!#"] as a regular expression, the result "20".
Why my expression is not worked and Can you propose more suitable expression?
labmaster 
*)Enclosed is the VI example in LV2009
Solved!
Go to Solution.
Attachments:
yahoo.vi ‏7 KB

labmaster wrote:
Hi, I want to extract the space (sometimes, !#" etc) from "@020 12345' using match pattern function.
You should also describe what you mean by "extract". If you simply need a space, you can use a space diagram constant. No need to extract it. Do you want the resulting string without the space, for example?
I am sure one of the regex gurus here will jump right on this one...
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Query giving wrong results

    Below is the query thats giving me wrong results ...can anyone help me figure where i am going wrong :(
    SQL> select count(*) from t where source='LP1.1';
      COUNT(*)
            69
    SQL> select count(*) from tblspring where line_a='LP1.1';
      COUNT(*)
           233now when i join these two table ...the total counts exceeds the expected records that i want
    SQL> select count(*) from t , tblspring where t.source=tblspring.line_a and t.source='LP1.1';
      COUNT(*)
         16077

    the thing is i want to filter only those records from table t where the column named  - source is equal to the column named line_a from table tblspring from the query in table t i get 69 records ....
    now when i match the it table tblspring with the condition
    i want the number of records should be less than or equal to 69 but not more than 69
    Edited by: Suhail Faraaz on Mar 5, 2011 7:31 AM

  • Match Regular Expression does not match what Match Pattern does

    I have read through a lot of posts about how Match Pattern does not match what Match Regular Expression will due to not processing some characters.
    However, I found a problem with the other way. A simple Reg-Ex that works in Match Pattern but not Match Regular Expression.
    What I have here is just an example. I want to use Match Regular Expression so I can specify some sub-matches.
    The reg-ex is for: one or more non-numeric characters, a space, one or more numeric characters. At the start of the string.
    How can I get this working in Match Regular Expression? I am working in LabVIEW 2010f2 32 bit. Here is the code snippet and the results:
    Rob
    Solved!
    Go to Solution.

    Robert Cole wrote:
    I think I prefer the ~ for negation since ^ is also used for beginning of the string. But we work with what we have.
    Let me offer you a tip and perhaps defend the honor of the regex a little bit.  One of my favorite features of regexes is the ability to specify character classes (and their negation).  One of the reasons I have to think about the ~ versus ^ is that I rarely use ^ in a regex alternative. 
    Some examples:
    [0-9] = \d (digit)
    [^0-9] = \D (not a digit)
    The equivalent regex for your case is: \D+ \d+

  • "Match Regular Expression" and "Match Pattern" vi's behave differently

    Hi,
    I have a simple string matching need and by experimenting found that the "Match Regular Expression" and "Match Pattern" vi's behave somewhat differently. I'd assume that the regular expression inputs on both would behave the same. A difference I've discovered is that the "|" character (the "vertical bar" character, commonly used as an "or" operator) is recognized as such in the Match Regular Expression vi, but not in the Match Pattern vi (where it is taken literally). Furthermore, I cannot find any documentation in Help (on-line or in LabVIEW) about the "|" character usage in regular expressions. Is this documented anywhere?
    For example, suppose I want to match any of the following 4 words: "The" or "quick" or "brown" or "fox". The regular expression "The|quick|brown|fox" (without the quotes) works for the Match Regular Expression vi but not the Match Pattern vi. Below is a picture of the block diagram and the front panel results:
    The Help says that the Match Regular Expression vi performs somewhat slower than the Match Pattern vi, so I started with the latter. But since it doesn't work for me, I'll use the former. But does anyone have any idea of the speed difference? I'd assume it is negligible in such a simple example.
    Thanks!
    Solved!
    Go to Solution.

    Yep-
    You hit a point that's frustrated me a time or two as well (and incidentally, caused some hair-pulling that I can ill afford)
    The hint is in the help file:
    for Match regular expression "The Match Regular Expression function gives you more options for matching
    strings but performs more slowly than the Match Pattern function....Use regular
    expressions in this function to refine searches....
    Characters to Find
    Regular Expression
    VOLTS
    VOLTS
    A plus sign or a minus sign
    [+-]
    A sequence of one or more digits
    [0-9]+
    Zero or more spaces
    \s* or * (that is, a space followed by an asterisk)
    One or more spaces, tabs, new lines, or carriage returns
    [\t \r \n \s]+
    One or more characters other than digits
    [^0-9]+
    The word Level only if it
    appears at the beginning of the string
    ^Level
    The word Volts only if it
    appears at the end of the string
    Volts$
    The longest string within parentheses
    The first string within parentheses but not containing any
    parentheses within it
    \([^()]*\)
    A left bracket
    A right bracket
    cat, cag, cot, cog, dat, dag, dot, and dag
    [cd][ao][tg]
    cat or dog
    cat|dog
    dog, cat
    dog, cat cat dog,cat
    cat cat dog, and so on
    ((cat )*dog)
    One or more of the letter a
    followed by a space and the same number of the letter a, that is, a a, aa aa, aaa aaa, and so
    on
    (a+) \1
    For Match Pattern "This function is similar to the Search and Replace
    Pattern VI. The Match Pattern function gives you fewer options for matching
    strings but performs more quickly than the Match Regular Expression
    function. For example, the Match Pattern function does not support the
    parenthesis or vertical bar (|) characters.
    Characters to Find
    Regular Expression
    VOLTS
    VOLTS
    All uppercase and lowercase versions of volts, that is, VOLTS, Volts, volts, and so on
    [Vv][Oo][Ll][Tt][Ss]
    A space, a plus sign, or a minus sign
    [+-]
    A sequence of one or more digits
    [0-9]+
    Zero or more spaces
    \s* or * (that is, a space followed by an asterisk)
    One or more spaces, tabs, new lines, or carriage returns
    [\t \r \n \s]+
    One or more characters other than digits
    [~0-9]+
    The word Level only if it begins
    at the offset position in the string
    ^Level
    The word Volts only if it
    appears at the end of the string
    Volts$
    The longest string within parentheses
    The longest string within parentheses but not containing any
    parentheses within it
    ([~()]*)
    A left bracket
    A right bracket
    cat, dog, cot, dot, cog, and so on.
    [cd][ao][tg]
    Frustrating- but still managable.
    Jeff

  • Searching and Matching - Difference between 'Match Pattern' and 'Match Geometric Pattern'?

    I was wondering if someone can explain to me the difference between  'Match Pattern' and 'Match Geometric Pattern' VIs? I'm really not sure which best to use for my application. I'm trying to search/match small spherical particles in a grey video in order to track their speed (I'm doing this after subtracting two subsequent frames to get rid of background motion artifacts).
    Which should I use?
    Thank you!
    Solved!
    Go to Solution.

    Hi TKassis,
    1.You may find from this link for the difference between these two,
    Pattern Match : http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_match_pattern_3/
    Geometric Match : http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_match_geometric_pattern/.
    2. I always prefer match pattern because of its execution speed, and incase of geometric pattern match it took lot of time to match your result. You may find in the attached figure for same image with these two algorithm execution time.
    Sasi.
    Certified LabVIEW Associate Developer
    If you can DREAM it, You can DO it - Walt Disney

  • Java Pattern Matcher (Pattern.class bug? Stuck in Infinite Loop)

    Hi,
    I'm using the java pattern matcher and it appears to be stuck in an infinite loop and will not return from Pattern.class.
    It stays stuck in the following two code sequences...
    I'm using the following regex...
    java.util.regex.Matcher[pattern=[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|biz|info) region=0,353648 lastmatch=
    MAIN BLOCK STUCK IN LOOP:
    boolean study(TreeInfo info) {
    if (type != INDEPENDENT) {
    int minL = info.minLength;
    atom.study(info);
    info.minLength = minL;
    info.deterministic = false;
    return next.study(info);
    } else {
    atom.study(info);
    return next.study(info);
    SECOND BLOCK STUCK IN LOOP:
    boolean match(Matcher matcher, int i, CharSequence seq) {
    // Check for zero length group
    if (i > matcher.locals[beginIndex]) {
    int count = matcher.locals[countIndex];
    if (count < cmin) {
    matcher.locals[countIndex] = count + 1;
    boolean result = body.match(matcher, i, seq);
    // If match failed we must backtrack, so
    // the loop count should NOT be incremented
    if (!result)
    matcher.locals[countIndex] = count;
    return result;
    if (next.match(matcher, i, seq))
    return true;
    if (count < cmax) {
    matcher.locals[countIndex] = count + 1;
    boolean result = body.match(matcher, i, seq);
    // If match failed we must backtrack, so
    // the loop count should NOT be incremented
    if (!result)
    matcher.locals[countIndex] = count;
    return result;
    return false;
    return next.match(matcher, i, seq);
    Is this a bug with the Java 1.6 Pattern Matcher?
    Thanks
    V$h3r

    The Java Pattern Matcher is getting stuck in the following code...
    boolean study(TreeInfo info) {
    if (type != INDEPENDENT) {
    int minL = info.minLength;
    atom.study(info);
    info.minLength = minL;
    info.deterministic = false;
    return next.study(info);
    } else {
    atom.study(info);
    return next.study(info);
    boolean match(Matcher matcher, int i, CharSequence seq) {
    // Check for zero length group
    if (i > matcher.locals[beginIndex]) {
    int count = matcher.locals[countIndex];
    if (count < cmin) {
    matcher.locals[countIndex] = count 1;
    boolean result = body.match(matcher, i, seq);
    // If match failed we must backtrack, so
    // the loop count should NOT be incremented
    if (!result)
    matcher.locals[countIndex] = count;
    return result;
    if (next.match(matcher, i, seq))
    return true;
    if (count < cmax) {
    matcher.locals[countIndex] = count + 1;
    boolean result = body.match(matcher, i, seq);
    // If match failed we must backtrack, so
    // the loop count should NOT be incremented
    if (!result)
    matcher.locals[countIndex] = count;
    return result;
    return false;
    return next.match(matcher, i, seq);
    }Here is a copy of the REGEX that I'm using...
    It works on most of the other STRINGS but when I do a REGEX on the the html source for http://www.exponent.com it will get stuck...
    Pattern p = Pattern.compile("[a-zA-Z0-9+_~-]+(?:\\.[a-zA-Z0-9+_~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+(?:com|org|net|biz|info|[a-zA-Z]{2})");Thanks,
    V$h3r

  • Wrong results after upgrading 10g database to 11.2.0.2.6

    Hi,
    Do anyone know, why the following query results are different?
    Not Working query:
    sql1:
    select col1 from tab1
    where col1 = (select '123' from dual)
    Working query:
    sql2:
    select col1 from tab1
    where col1 = '123';
    Both the sql1 and sql2 are returning same reseults in 10g database , but not in 11g.

    Pl post OS details along with sample outputs and explain plans from the the sql1 statement from the two databases. These MOS Docs may help also
    Things to Consider Before Upgrading to 11.2.0.2 to Avoid Poor Performance or Wrong Results [ID 1320966.1]
    Wrong Results on 11.2.0.2 with Function-Based Index and OR Expansion [ID 1264550.1]
    Wrong Results/No Rows for Sql Involving Functions in 11.2.0.2. [ID 1380679.1]
    HTH
    Srini

  • How do I use the Match Pattern Function to exclude only 0.000?

    Hi,
    I'm trying to use the mattch pattern function to find the first string in a table thats is >0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    Thanks for the help
    Matt

    "Matt361" <[email protected]> wrote in message news:[email protected]..
    Hi,
    &nbsp;
    I'm trying to use the mattch pattern function to find the first string in a table thats is &gt;0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    &nbsp;
    Thanks for the help
    Matt
    &nbsp;
    Hi,
    1,[~0] matches a "1" a "," and then any character that is not "0".
    1,[0-9].+[~0] matches a "1" a "," and then any character that is "0-9", any number of anything!! (1 or more) and then anything that is not "0". Note that you have to escape a . to match a ".". Like this "\.".
    There is no way to check if there is anything other then a "0" in the match, from within the match pattern function. So I think you won't be able to find a pattern that does the trick.
    Why not use a whileloop to find the first item? Or use the Spreadsheet String To Array, and then compare the desired row or column with the string "0.000000"? (Or replace all ,0.000000, by a string like ",NULL,", then match the pattern?)
    In LabVIEW 8 there is a new Match Regular Expression function. Haven't tried it, but it should be much more powerfull then the Match Pattern function. But also much more complex.
    Regards,
    Wiebe.

  • Match Pattern does not function properly when searching for a null character

    I'm using Match Pattern to extract a null terminated string from a response I'm getting from a device on a serial port. The VI is attached and below is a screenshot of the block diagram.
    It works just fine with index set to 0, 1, or 2. When index is 3, I get the output shown below.
    Why is Match Pattern not finding the null character?
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Grab Nullterm String.vi ‏15 KB

    I'm a dope, need to remove the wire from the Offset control to the Match Pattern control.
    DUH!

  • Content Search Web Part displaying wrong Results for anonymous Users.

    HI Forum Group,
    I am getting Wrong results for my content search web part. The requirement is to show the News Description for the selected news item.
    I have a catalog site which stores News like 
    News1
    News2
    News3
    as Items. and i have connected this catalog in publishing site which is anonymous. In the publishing site created one page "News.aspx"added search results webpart which shows all the news item. Added one page "Description.aspx" to show
    description to show the selected news item.
    When ever user selects any news from news.aspx page it will redirected to description.aspx with the selected item ID
    The "Description.aspx" the search results page gets the data based on the URL by QueryString parameter as shown below
    The problem is, if i multiple items to open in tabs all the items are showing the data same as the first selected item, though the article ID is different.
    Thanks
    Sithender

    Hi,
    Thank you for your feedback on how you were successful in resolving this issue.
    Your solution will benefit many other users, and we really value having you as a Microsoft customer.
    Have a nice day!
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • NOT IN operator giving the wrong results

    DB version:10gR2
    Why is NOT IN giving the wrong results. Isn't NOT EXISTS operator a flawless alternative to NOT IN?
    create table my_table1 (col1 number);
    insert into my_table1 values (1);
    insert into my_table1 values (2);
    commit;
    create table my_table2 ( col1 number);
    insert into my_table2 values (1);
    commit;
    select * from my_Table1;
           COL1
              1
              2
    select * from my_table2;
           COL2
              1
      --correct result
      SELECT * FROM my_table1 t1 WHERE NOT EXISTS
    (SELECT * FROM my_table2 t2 WHERE t1.col1 = t2.col1)
           COL1
              2
    ---correct result using IN
    SELECT * FROM my_table1 t1 where col1 not in (select col1 FROM my_table2 t2);
           COL1
              2
    Inserting a NULL to my_Table2
    Now the query using NOT IN is returning wrong results.
    insert into my_table2 values (null);
    commit;
    SELECT * FROM my_table1 t1 where col1 not in (select col1 FROM my_table2 t2);
    no rows selected
    Query using NOT EXISTS is still giving the right results.
    SELECT * FROM my_table1 t1 WHERE NOT EXISTS
       (SELECT * FROM my_table2 t2 WHERE t1.col1 = t2.col1);
           COL1
              2

    ScottsTiger wrote:
    can i use NOT EXISTS(with a proper Co-related subquery) as a safe alternative to NOT IN?Depends on your data and what you need to achieve.
    Personally I avoid using NOT EXISTS or NOT IN if I can really help it.
    My preferred method is to outer join the tables together and then remove any resultant rows where a value exists and I didn't want one. ;)

  • Wrong results for context search on empty element tags

    I'm using Oracle DBMS 11.1 and 11.2 and created a context index on an XML column (section group: PATH_SECTION_GROUP).
    When entering a query like
    SELECT count(*) FROM my_table t WHERE contains (t.co_xml,'hasPath(/tag1/tag2)') > 0
    I get wrong results if tag2 is an empty element tag (<tag2/>) that appears somewhere within the
    XML instance, but NOT directly under tag1.
    E.g., the following XML instance is found (but shouldn't!):
    <a>
    <tag1>bla<tag3>bla</tag3></tag1>
    <tag4>bla<tag2/></tag4>
    </a>
    This seems to happen only for empty element tags. Is this a known bug and does anybody know a workaround?
    Thanks in advance for your help!
    Roman

    I am unable to reproduce the problem. Can you provide a copy and paste of an actual run, including create table, insert data, create index, and select, as I have done below?
    SCOTT@orcl_11g> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE     11.1.0.6.0     Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SCOTT@orcl_11g> create table my_table
      2    (co_xml     xmltype)
      3  /
    Table created.
    SCOTT@orcl_11g> insert into my_table values (
      2  xmltype ('<?xml version="1.0"?>
      3  <tag5>
      4    <tag1>bla<tag3>bla</tag3></tag1>
      5    <tag4>bla<tag2/></tag4>
      6  </tag5>'))
      7  /
    1 row created.
    SCOTT@orcl_11g> create index my_idx
      2  on my_table (co_xml)
      3  indextype is ctxsys.context
      4  parameters ('section group ctxsys.path_section_group')
      5  /
    Index created.
    SCOTT@orcl_11g> SELECT count(*)
      2  FROM   my_table t
      3  WHERE  contains (t.co_xml, 'hasPath (//tag1/tag2)') > 0
      4  /
      COUNT(*)
             0
    SCOTT@orcl_11g> SELECT count(*)
      2  FROM   my_table t
      3  WHERE  contains (t.co_xml, 'hasPath (//tag1/tag3)') > 0
      4  /
      COUNT(*)
             1
    SCOTT@orcl_11g>

  • Timestamp - wrong results during clock change

    When I run for example:
    SELECT TO_TIMESTAMP('28.03.2010 02:00:00','DD.MM.YYYY HH24:MI:SS') FROM dual
    on worksheet, I receive two different results:
    Script Output:
    28.03.2010 02:00:00
    Query Result:
    28.03.2010 03:00:00
    What is the reason for the wrong result in "Query Result"?
    Rainer

    Things that might influence, but could be different for you:
    - WinXP SP3 Catalonia/Spain locale (adjusts to summer-time)
    - AddVMOption -Duser.language=en
    - AddVMOption -Doracle.jdbc.mapDateToTimestamp=false
    - sqldev NLS Language/Territory: American/America
    Hope that helps,
    K.

  • Wrong result in Web Intelligence Report

    Post Author: shriram81
    CA Forum: WebIntelligence Reporting
    When I run a query for web inteeligence documnet I receive a wrong result. But when I run the same SQL query in SQL analyzer of MS SQL server I get correct result.
    e.g. I get the same value of measure object against different dimension in web inteeligence report but I get correct values of measure when I run the query in query analyzer on SQl server
    Pl guide me to get correct result in Webi

    Post Author: GregPye
    CA Forum: WebIntelligence Reporting
    Are you copying and pasting the query from WebI into SQL Server? Seems a bit odd, as the SQL should be sent to SQL Server to run...
    I would check the report level settings, such as filters, or what have you... also check that there aren't more than one SQL query being run in WebI that you haven't noticed...
    Cheers

  • Bug 2679062 - Wrong results possible from multi-column INLIST - though stat

    Hi,
    The following test case is supplied in the metalink in bug no. 2871341, the base bug for this bug is 2679062.
    REPRODUCIBILITY:
    Reproduces constantly with simple test case below:
    TEST CASE:
    DROP TABLE A1
    CREATE TABLE A1 (X1 VARCHAR2(10), X2 VARCHAR2(10))
    REM *********** Create the second table: ***************
    DROP TABLE A2
    CREATE TABLE A2 (X1 VARCHAR2(10), X2 VARCHAR2(10))
    INSERT INTO A1 VALUES ('1','2');
    INSERT INTO A2 VALUES ('3','4');
    COMMIT;
    CREATE INDEX A1_X1 ON A1(X1 );
    CREATE INDEX A1_X2 ON A1(X2);
    CREATE INDEX A2_X1 ON A2(X1);
    CREATE INDEX A2_X2 ON A2(X2);
    CREATE OR REPLACE VIEW A_ALL AS SELECT * FROM A1 UNION ALL SELECT * FROM A2;
    ANALYZE TABLE A1 COMPUTE STATISTICS;
    ANALYZE TABLE A2 COMPUTE STATISTICS;
    SELECT * FROM A_ALL;
    SELECT * FROM A_ALL WHERE (X1='1' AND X2='2') ;
    SELECT * FROM A_ALL WHERE ((X1='1' AND X2='2') OR (X1='3' AND X2='4'));
    The 2nd query returns answer while the second is not !
    The following is published in the 9.2.0.4 fixed bug list:
    " 9204 - 2679062 - Wrong results possible from multi-column INLIST "
    I have installed 9.2.0.4 patch set on a win 2000 machine Oracle and saw that the above case is actually solved but our application which has a very similar case doesn't.
    After investigating I found the following test case that fails, it reproduces only when you have index on all columns (covering index):
    drop table t1_1;
    drop table t1_2;
    create table t1_1(c1 number, c2 number, c3 number);
    create table t1_2(c1 number, c2 number, c3 number);
    create index t1_1_ix on t1_1(c1, c2, c3);
    create index t1_2_ix on t1_2(c1, c2, c3);
    create or replace view t1 as select * from t1_1 union all select * from t1_2;
    insert into t1_1 values(1, 2, 100);
    insert into t1_2 values(1, 2, 200);
    commit;
    analyze table t1_1 compute statistics;
    analyze table t1_2 compute statistics;
    prompt
    prompt #######################################
    prompt try 1 - works fine
    prompt #######################################
    prompt
    select * from t1
    where
    (c1=1)
    and
    ( (c2=2) and (c3=100)
    prompt
    prompt #######################################
    prompt try 2 - works fine
    prompt #######################################
    prompt
    select * from t1
    where
    (c1=1)
    and
    (c2=2) and (c3=200)
    prompt
    prompt #######################################
    prompt try 3 - try 1 OR try 2 does not work !
    prompt #######################################
    prompt
    select * from t1
    where
    (c1=1)
    and
    ( ( (c2=2) and (c3=100) )
    or
    ( (c2=2) and (c3=200) )
    opened a TAR and wanted to share with you.
    Tal Olier ([email protected]).

    Hi,
    The following test case is supplied in the metalink in bug no. 2871341, the base bug for this bug is 2679062.
    REPRODUCIBILITY:
    Reproduces constantly with simple test case below:
    TEST CASE:
    DROP TABLE A1
    CREATE TABLE A1 (X1 VARCHAR2(10), X2 VARCHAR2(10))
    REM *********** Create the second table: ***************
    DROP TABLE A2
    CREATE TABLE A2 (X1 VARCHAR2(10), X2 VARCHAR2(10))
    INSERT INTO A1 VALUES ('1','2');
    INSERT INTO A2 VALUES ('3','4');
    COMMIT;
    CREATE INDEX A1_X1 ON A1(X1 );
    CREATE INDEX A1_X2 ON A1(X2);
    CREATE INDEX A2_X1 ON A2(X1);
    CREATE INDEX A2_X2 ON A2(X2);
    CREATE OR REPLACE VIEW A_ALL AS SELECT * FROM A1 UNION ALL SELECT * FROM A2;
    ANALYZE TABLE A1 COMPUTE STATISTICS;
    ANALYZE TABLE A2 COMPUTE STATISTICS;
    SELECT * FROM A_ALL;
    SELECT * FROM A_ALL WHERE (X1='1' AND X2='2') ;
    SELECT * FROM A_ALL WHERE ((X1='1' AND X2='2') OR (X1='3' AND X2='4'));
    The 2nd query returns answer while the second is not !
    The following is published in the 9.2.0.4 fixed bug list:
    " 9204 - 2679062 - Wrong results possible from multi-column INLIST "
    I have installed 9.2.0.4 patch set on a win 2000 machine Oracle and saw that the above case is actually solved but our application which has a very similar case doesn't.
    After investigating I found the following test case that fails, it reproduces only when you have index on all columns (covering index):
    drop table t1_1;
    drop table t1_2;
    create table t1_1(c1 number, c2 number, c3 number);
    create table t1_2(c1 number, c2 number, c3 number);
    create index t1_1_ix on t1_1(c1, c2, c3);
    create index t1_2_ix on t1_2(c1, c2, c3);
    create or replace view t1 as select * from t1_1 union all select * from t1_2;
    insert into t1_1 values(1, 2, 100);
    insert into t1_2 values(1, 2, 200);
    commit;
    analyze table t1_1 compute statistics;
    analyze table t1_2 compute statistics;
    prompt
    prompt #######################################
    prompt try 1 - works fine
    prompt #######################################
    prompt
    select * from t1
    where
    (c1=1)
    and
    ( (c2=2) and (c3=100)
    prompt
    prompt #######################################
    prompt try 2 - works fine
    prompt #######################################
    prompt
    select * from t1
    where
    (c1=1)
    and
    (c2=2) and (c3=200)
    prompt
    prompt #######################################
    prompt try 3 - try 1 OR try 2 does not work !
    prompt #######################################
    prompt
    select * from t1
    where
    (c1=1)
    and
    ( ( (c2=2) and (c3=100) )
    or
    ( (c2=2) and (c3=200) )
    opened a TAR and wanted to share with you.
    Tal Olier ([email protected]).

Maybe you are looking for