Xpath query using greater than operator

I'm trying to evaluate some xml to determine if it matches some criterium.
MyXmlColumns contains the following kind of data "<Values><Value>data1</Value><Value>data2</Value><Values>"
When I execute the following query I get zero rows returned when it should match some rows containing this data.
select * from mydata
where existsNode(MyXmlColumn, '/Values/Value[. > "data1"]') = 1
The question is why greter than, lesser than, does not work, and if there is any alternative.
If I use equals operator, or greater than but using a number it works.
I know that I can use XmlExists function but I'm using Oracle 9i r2 so it's not an option.
Thanks in advance for any suggestion.

but I'm using Oracle 9i r2
The question is why greter than, lesser than, does not workWorks on 9.2.0.8:
SQL> select * from v$version where rownum = 1
BANNER                                                         
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
1 row selected.
SQL> with mydata as
   select xmltype('<Values><Value>data1</Value><Value>data2</Value></Values>') MyXmlColumn from dual
select * from mydata t where existsNode(t.MyXmlColumn, '/Values/Value') < 3
MYXMLCOLUMN                                                              
<Values>                                                                 
  <Value>data1</Value>                                                   
  <Value>data2</Value>                                                   
</Values>                                                                
1 row selected.

Similar Messages

  • KQL query using "Greater Than" fails

    I have developed a CSOM app that does a KQL query against several managed properties. One of these properties is numeric (mapped to RefinableDouble01), so I have a greater than (>) comparison in the query string:
         RefinableDouble01>41.12345
    I developed the app in Office 365 and when I run the query there, it works fine (no errors).  However, when I run it to our internal SharePoint 2013 site, it fails with the error:
         "We didn't understand your search terms. Make sure they're using proper syntax."
    As far as I can tell, the configuration of the internal site matches the Office 365 site.
    If I use a query on a text property, so that I don't use the greater than comparison, that query works. The query results from that query also show that the managed property RefinableDouble01 is properly mapped and returns the expected numeric value.
    Does anyone know what the problem is? I'm wondering if the KQL query functionality is not properly set up in our internal site, but that is not an area that I am familiar with.
    Bob Feldman

    Here is more information, from the ULS Log file, regarding the error:
    06/27/2014 11:05:13.47  NodeRunnerQuery1-d8a6a564-7b37- (0x0BA4) 0x0DC4 Search                         Query Processing             
     aizc0 High     Microsoft.Office.Server.Search.Query.Ims.ImsQueryInternal : New request: Query text 'RefinableDouble01>41.12345', Query template ''; HiddenConstraints: ; SiteSubscriptionId: 00000000-0000-0000-0000-000000000000 fa039f9c-0884-60df-c11a-64f9b09837c4
    06/27/2014 11:05:13.48  NodeRunnerQuery1-d8a6a564-7b37- (0x0BA4) 0x0DC4 Search                         Query Processing             
     aizgn Medium   Microsoft.Office.Server.Search.Query.Pipeline.Executors.QueryPipelineHardWiredFlowExecutor : (FlowExecutor)eventSearchFlowDone: d8a6a564-7b37-4815-a35f-f97acc0d6cba, RefinableDouble01>41.12345, Microsoft.ProductivitySearchFlow,
    0, SPWFEAPP, Error=Exception occurred due to some other exception fa039f9c-0884-60df-c11a-64f9b09837c4 fa039f9c-0884-60df-c11a-64f9b09837c4
    06/27/2014 11:05:13.48  NodeRunner.exe (0x0BA4)                  0x0DC4 SharePoint Server Search       Query                        
     aisyt High     ExecuteFlowInternal FlowExecutor:Microsoft.ProductivitySearchFlow Exception: Microsoft.Ceres.Evaluation.DataModel.CommonEvaluationException: Exception occurred due to some other exception ---> Microsoft.Office.Server.Search.Query.QueryMalformedException:
    Query 'RefinableDouble01>41.12345' failed: syntax error at position 0, The operation is illegal for the given property, property expression: RefinableDouble01>41.8882213637562     --- End of inner exception stack trace ---    
    at Microsoft.Office.Server.Search.Query.Pipeline.Processing.KeywordQueryParserEvaluator.KeywordQueryParserProducer.ParseKeywordQuery(String queryText, ParsingContext parsingContext, Boolean debugMode, String& searchTerms)     at Microsoft.Office.Server.Search.Query.Pipeline.Processing.KeywordQueryParserEvalua... fa039f9c-0884-60df-c11a-64f9b09837c4
    06/27/2014 11:05:13.48  w3wp.exe (0x196C)                        0x41B0 SharePoint Server Search       Query                        
     dk68 High     SearchServiceApplication::Execute--Exception: Microsoft.Office.Server.Search.Query.QueryMalformedException: We didn't understand your search terms. Make sure they're using proper syntax. ---> System.ServiceModel.FaultException`1[Microsoft.Office.Server.Search.Administration.SearchServiceApplicationFault]:
    Query 'RefinableDouble01>41.12345' failed: syntax error at position 0, The operation is illegal for the given property, property expression: RefinableDouble01>41.8882213637562    Server stack trace:      at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime
    operation, ProxyRpc& rpc)     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)     at ... fa039f9c-0884-60df-c11a-64f9b09837c4

  • Greater than operator for obiee analysis

    Hi ALL,
    Just want to ask if it is possible to use date for the greater than operator in creating obiee analysis?
    for example: I want to get months greater than January 2015 for specific measure.
    Thanks in advance

    but I'm using Oracle 9i r2
    The question is why greter than, lesser than, does not workWorks on 9.2.0.8:
    SQL> select * from v$version where rownum = 1
    BANNER                                                         
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    1 row selected.
    SQL> with mydata as
       select xmltype('<Values><Value>data1</Value><Value>data2</Value></Values>') MyXmlColumn from dual
    select * from mydata t where existsNode(t.MyXmlColumn, '/Values/Value') < 3
    MYXMLCOLUMN                                                              
    <Values>                                                                 
      <Value>data1</Value>                                                   
      <Value>data2</Value>                                                   
    </Values>                                                                
    1 row selected.

  • Partition by range using greater than or in between statment?

    Can you partition by range using greater than or in between statment? If so, can someone please post the syntax?

    ji**** wrote:
    Can you partition by range using greater than or in between statment? If so, can someone please post the syntax?http://download.oracle.com/docs/cd/B10500_01/server.920/a96524/c12parti.htm
    CREATE TABLE sales_range
    (salesman_id  NUMBER(5),
    salesman_name VARCHAR2(30),
    sales_amount  NUMBER(10),
    sales_date    DATE)
    PARTITION BY RANGE(sales_date)
    PARTITION sales_jan2000 VALUES LESS THAN(TO_DATE('02/01/2000','DD/MM/YYYY')),
    PARTITION sales_feb2000 VALUES LESS THAN(TO_DATE('03/01/2000','DD/MM/YYYY')),
    PARTITION sales_mar2000 VALUES LESS THAN(TO_DATE('04/01/2000','DD/MM/YYYY')),
    PARTITION sales_apr2000 VALUES LESS THAN(TO_DATE('05/01/2000','DD/MM/YYYY'))
    );

  • How to use (greater than) in web services call

    Hello, I am trying to query a set of assets where the external unique ID is greater than 400,000. My existing code looks like
    qryIn.ListOfAsset(0).ExternalSystemId = ">'400000'"
    However, using this will return any asset record starting with a 5 or above as far as I can tell, I assume b/c it is comparing string data due to the single quotes infering data of type text (string). Is it possible to use comparison operators with numeric data correctly?
    I posed this question to support and received the below answer:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <AssetWS_AssetQueryPage_Input xmlns="urn:crmondemand/ws/asset/"> <ListOfAsset xmlns="urn:/crmondemand/xml/asset"> <Asset> <AssetId /> <PurchaseDate/> <OwnerAccountId /> <ExternalSystemId>&gt; '400000'</ExternalSystemId> </Asset> </ListOfAsset> </AssetWS_AssetQueryPage_Input> </soap:Body> </soap:Envelope>
    Basically, instructing me to use &gt. I'm doing coding in .NET visual studio and not using the XML as above. However, I did try the following:
    qryIn.ListOfAsset(0).ExternalSystemId = "&gt;'400000'" which returned an error in the compiler.
    Any help would be appreciated. Thanks.

    Thanks for the reply. I would assume "external system id" is an integer, but, I will test on a custom field that I now is of type integer.
    Could you take your same code and use a non-zero value for the operand? For example, could you try
    objAccQryParam.ListOfAccount[0].CustomInteger0 = ">= '10'"; and let me know if that returns values that are greater than or equal to 10. Using a two digit number is important. Assuming you have data greater than 10.
    Thanks!

  • Greater than operator in Hana

    Hi, I have a quey inside a Xml File and I need to use the Comparasion Operator for "Greater than" in this way : &gt;
    Question: Does Hana Syntax support  &gt; ?

    Hi there,
    Was '>' or '<' not working from XML? I used a > operator in a calculated column  and then exported the HANA model to see the XML file of it. It has something like this below:
    <formula>IF(&quot;EMP NO &quot; >=3,&quot;EMPLOYEE NAME&quot;,&quot;GENDER&quot;)</formula>
    Regards,
    Krishna Tangudu

  • Greater than operator for date in obiee analysis

    Hi all,
    I just need your help. is it possible to use the greater than or less than operator (in filter) for date in creating analysis?
    FOr example: I need to have the greater than months from "January 2015" for specific measure.
    Thanks!

    Somehow the person records for this person have become corrupted. Have you any idea how that might have happened? Options:
    1) Someone or some program has issued a direct table update on per_all_people_f
    2) Someone has used Help > Diagnostics > Examine to modify the data
    3) An Oracle bug. This one is unlikely but could happen if using an unusual form (Shared Person Form, for example) and perform a weird combination of actions/keystrokes. But you'd need to be able to reproduce it if you want Oracle to fix it.
    If you're support contract is invalid or you don't have a support contract your options are limited. You can either:
    a) Bring your patch level up-to-date and then raise an SR. If Oracle agree to provide a script to fix it they'll probably just do direct table updates to resolve this record.
    b) Fix this yourself using direct table updates. This obviously isn't supported either. If you do this, make sure you know what you're doing and get it 100% right first time. BE VERY CAREFUL!
    Obviously I strongly recommend option b.

  • Date Greater Than Operator

    I am comparing two date fields from two tables. Both are in DATE format. The dates look like this: 22-Apr-2006 07:00:10 AM and 01-Jun-2007 12:00:00 AM. I am adding this statement to a WHERE clause:
    and vendors.vend_obsolete_date > document_xref.acceptance_date;
    In this particualr case, I should get no result because the 1st date came before the 2nd date. But when I run my program, it seems to be ignoring my > statement. Is using a greater than sign the proper syntax to compare if the 1st date field is bigger (came after) another?
    Thanks!

    Greater than works on DATE columns, no problem. A simple test confirms it.
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 9 17:50:52 2007
    select 'oops, something is wrong' as result
    from   dual
    where
      to_date( '22-Apr-2006 07:00:10 AM', 'dd-Mon-yyyy hh12:mi:ss AM' )
      > to_date( '01-Jun-2007 12:00:00 AM', 'dd-Mon-yyyy hh12:mi:ss AM' )
    no rows selectedThere must be something else about your query or data that's causing the anomaly.
    Joe Fuda
    SQL Snippets

  • Greater than operator in SQL

    Hi friends,
    A table has 2 colums A and B.How i can return a flag ,say 1 if A is greater than B or 0 if A is less than B,by using SQL.
    Can any one help me out.
    thanks and regards,
    Ajith

    select a,b,case when a > b then 1
                    when a=b   then 0
                    else -1
               end FLAG
    from table;                                                                                                                                                                                                                                                                               

  • Problem with Filtering Data by Using "Greater Than" in APD

    Dear Experts,
      First of all, I am a novice of SAP Data Mining. I try to filter data in APD by using the 'Restrict Amont of Data (the Filter Icon).' My problem is really simple. I don't know how to filter data which have value greater than a constant.
    For example, I try to keep only records which have a quantity greater than 1000.
      At the selection option in the single value tab, I found only the '=' option. The options like '>', '<', '>=', etc are not found. Could anyone suggest me please?

    I do appreciate your prompt response.
    Seemingly, using the interval is our best solution, though it is not best for our customers.
    Having already gone through the note you gave me, in fact, it is really pertinent. Unfortunately, our support package is now 13, and it is extremely difficult to retest our system if we decide to apply the support package 16.
    Are there any other solution?
    By the way, you deserve my point.

  • Xpath query using ANE with AIR3.9 for iOS app

    we are building an app for iOS using AIR 3.9 where we have to load and parse the xml document so that we can read the images path and download the stuff on iOS device. To fix this issue we have found a solution using XCode via ANE where by using XPath Query classes such as "PerformXPathQuery", "PerformXMLXPathQuery", "xmlReadMemory" etc. The code is running well when build on simulator itself on mac machine. But when we are packaging the ANE with AIR 3.9, it gives us the error which says that:-
    Error occurred while packaging the application:
    Undefined symbols for architecture armv7:
      "_xmlReadMemory", referenced from:
          _PerformXMLXPathQuery in libnet.example.download.a(ExampleLib.o)
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    I have tried linking binary with libraries like "libxml2.dylib", "libxml2.2.dylib" and libz.dylib + added the libXML header files to the header search path in the build properties, but got no help.
    our AIR 3.9 platform xml looks like:-
    <platform xmlns="http://ns.adobe.com/air/extension/3.9">
        <sdkVersion>4.0.0</sdkVersion>
        <linkerOptions>
            <option>-ios_version_min 4.2</option>
            <option>-framework UIKit</option>
            <option>-framework Foundation</option>
            <option>-framework CoreText</option>
        </linkerOptions>
    </platform>
    can anyone suggest where we are going wrong!
    thanks in advance

    Found the solution, i was missing the framework related to xPath library in platform.xml
    follow the instuctions from the below link:-
    http://forums.adobe.com/thread/1037904
    thanks adobe team

  • Using greater than - less than in a date query in a form

    In version 5, the user could put in ">03/05/08" in a date field, hit the execute query button, and the form would pull up everything >3/5/2008. In version 10g, I get all format errors when I put in the same thing. Is there a work-around, or is this feature no longer supported in 10g?

    I assume you have recently performed an upgrade to Forms 10g. Did you only upgrade to Forms 10g or were their other upgrades as well (like the Database)? Has the NLS_DATE_FORMAT changed? Can you run your query in SQL*Plus successfully? Any additional information you can provide will greatly aid us in helping you troubleshoot this issue.
    Craig...

  • Binding parameter to SQL/xpath query using java/jdbc

    I'm trying to execute a query containing an xpath.
    The query looks like this:
    select * FROM table  t where t.column.existsNode('/RootElement[contains(SubElement, "someVal")]/SubElement')In java replacing the "someVal" with a bind parameter "?" will not work:
    PreparedStatement ps = c.prepareStatement("select * FROM table t where t.column.existsNode('/RootElement[contains(SubElement, ? )]/SubElement') = 1");
    ps.setString(1,"someVal");
    =EXCEPTIONOn this forum I found that you can also use '||:namedParam||'
    So the query in java would be executed like;
    PreparedStatement ps = c.prepareStatement("select * FROM table t where t.column.existsNode('/RootElement[contains(SubElement, '||:1||' )]/SubElement') = 1");
    ps.setString(1,"someVal");This seems to work (I have no idea what the '|| ||' construct does, I don't seem to find any info about it)
    HOWEVER, it seems that doing it this way the value being bound is NOT escaped.
    So, doing this will yield in an orcale SQL/xpath exception:
    ps.setString(1,"som'eVal");
    I've went to all the oracle xml manual stuff I could find, but nowhere do they address this.
    Any one an idea how I can bind the value and still have escaping ?
    Edited by: user5893566 on Nov 27, 2008 12:06 AM
    Edited by: user5893566 on Nov 27, 2008 12:15 AM

    Would you mind explain me what the replace actually does?The idea is like this:
    Let's start with a string like some'V"al and surround it by the concat function:
      '...concat("' || some'V"al || '") ....' {code}
    replace the inner (i.e. all) double quotes with +",''","+ to obtain '...concat("' || some'V",''"'',"al || '") ...' {code}
    So this concatenates three parts of the original string where the double quotes are now enclosed by two single quotes. The resulting string should look like
    {code} '...concat("some'V",''"'',"al") ...'i.e. first argument of concat is enclosed by double quotes, the second one by two single quotes and the third one again by double quotes.  This is just a rewritten form of our original string!.
    Now incorporate the whole thing in the xpath expression  as shown in my previous example and it should work ;)
    hth
    michael                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • (BUG): using less than operator in javascript

    I am using Jdeveloper 11.1.1.5.0, ADF BC, ADF Faces.
    I am trying to add some java script validation in my page, just want to check if the length of an input field is less than three or not.
    here is the function I used
    function filterForNumbers(evt){
    var inputField = evt.getSource();
    var oldValue  = inputField.getValue();
    var myField   = inputField.findComponent("it2");
    var len = oldValue.length;
    if (len < 3)      
       alert ("the length is <  3" );
       myField.setValue("");
    }when I use the less then operator (<) in this part
    if (len < 3)ADF frame work considers the < as an open tag and when I run the page, it shows this error message in the log
    Error(16,16):  Illegal token.
    and the page does not run.
    workaround*
    using this syntax instead
    if (3 > len)

    Thank again Sireesha,
    I tried your suggestion with and without space. What I get is that the there is no thing on the page (only blank page is shown).
    here is my page source
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" partialTriggers="it2">
          <af:resource type="javascript">
           function filterForNumbers(evt){
           var inputField = evt.getSource();
           var oldValue = inputField.getValue();
           var myField = inputField.findComponent("it2");
           var len = oldValue.length;
           if (len &lt 3)      
             alert ("the length is <  3" );
             myField.setValue("");
          </af:resource>
          <af:messages id="m1"/>
          <af:form id="f1">
            <af:panelFormLayout id="pfl1">
              <af:inputText value="#{bindings.Id.inputValue}"
                            label="#{bindings.Id.hints.label}"
                            required="#{bindings.Id.hints.mandatory}"
                            columns="#{bindings.Id.hints.displayWidth}"
                            maximumLength="#{bindings.Id.hints.precision}"
                            shortDesc="#{bindings.Id.hints.tooltip}" id="it1">
                <f:validator binding="#{bindings.Id.validator}"/>
                <af:convertNumber groupingUsed="false"
                                  pattern="#{bindings.Id.format}"/>
              </af:inputText>
              <af:inputText value="#{bindings.Description.inputValue}"
                            label="#{bindings.Description.hints.label}"
                            columns="#{bindings.Description.hints.displayWidth}"
                            maximumLength="#{bindings.Description.hints.precision}"
                            shortDesc="#{bindings.Description.hints.tooltip}"
                            id="it2" required="true">
                <f:validator binding="#{bindings.Description.validator}"/>
                <af:clientListener method="filterForNumbers" type="valueChange"/>
              </af:inputText>
              <af:inputText value="#{bindings.Flag.inputValue}"
                            label="#{bindings.Flag.hints.label}"
                            required="#{bindings.Flag.hints.mandatory}"
                            columns="#{bindings.Flag.hints.displayWidth}"
                            maximumLength="#{bindings.Flag.hints.precision}"
                            shortDesc="#{bindings.Flag.hints.tooltip}" id="it3">
                <f:validator binding="#{bindings.Flag.validator}"/>
              </af:inputText>
              <f:facet name="footer">
                <af:panelGroupLayout layout="vertical" id="pgl2">
                  <af:panelGroupLayout layout="horizontal" id="pgl1">
                    <af:commandButton actionListener="#{bindings.First.execute}"
                                      text="First"
                                      disabled="#{!bindings.First.enabled}"
                                      partialSubmit="true" id="cb3"/>
                    <af:commandButton actionListener="#{bindings.Previous.execute}"
                                      text="Previous"
                                      disabled="#{!bindings.Previous.enabled}"
                                      partialSubmit="true" id="cb4"/>
                    <af:commandButton actionListener="#{bindings.Next.execute}"
                                      text="Next"
                                      disabled="#{!bindings.Next.enabled}"
                                      partialSubmit="true" id="cb5"/>
                    <af:commandButton actionListener="#{bindings.Last.execute}"
                                      text="Last"
                                      disabled="#{!bindings.Last.enabled}"
                                      partialSubmit="true" id="cb1"/>
                  </af:panelGroupLayout>
                  <af:commandButton text="Submit" id="cb2"/>
                </af:panelGroupLayout>
              </f:facet>
            </af:panelFormLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>

  • Updates using greater than or less than logic....

    Hi, I've run into something that I can't figure out how to do through the OWB GUI. I have a source table that tells me that data changed between a given effective start and effective end dates (for example, NAME information). Given that, I want to update all rows in the person dimension tied to the matching person, where the effective date on the person dim is between the effective start and end dates on the source table.
    Using the standard update operator, it looks like the only option I have is "=", I can't specify "<=" or ">=".
    Is there any (easy) way around this?
    Thanks,
    Scott

    I'd like to expand on Bharad's join condition.
    Keep in mind that you have to use the effective start date two times (see below).
    ingrp1 a.person_id =ingrp2 b.person_id
    and ingrp1 a.effective_start_date >= ingrp2 b.effective_start_date
    and ingrp1 a.effective_startdate <= ingrp2 b.effectiveend_date
    Also, in most dimension tables the effective end date can contain NULL values which we need to take care off as well otherwise we will 'lose' records. A NVL can fix that problem, for example:
    ingrp1 a.person_id =ingrp2 b.person_id
    and ingrp1 a.effective_start_date >= ingrp2 b.effective_start_date
    and ingrp1 a.effective_start_date <= nvl( ingrp2 b.effective_end_date, sysdate)
    You can also substitute sysdate for a fixed date in the future but it's not dynamic then.

Maybe you are looking for