Syntax of XPATH query question

Hi people.

Have a read of the documentattion, but maybe I'm missing something subtle.

Given the following XML code (extract)
  <?xml version="1.0" ?> 
- <IndividualAnnex xmlns="https://infocentre.gsm.org/TADIG-RAEX-AA14" xmlns:tadig-gen="https://infocentre.gsm.org/TADIG-GEN" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://infocentre.gsm.org/TADIG-RAEX-AA14 tadig-raex-aa14-3.0.xsd">
  - <ContactInformationList>
    - <Contact contactInformationID="111">
      - <ContactPerson>
        <tadig-gen:GivenName>Joe</tadig-gen:GivenName> 
        <tadig-gen:FamilyName>Bloggs</tadig-gen:FamilyName> 
      - <tadig-gen:PhoneFixList>
          <tadig-gen:PhoneFix>888888888888</tadig-gen:PhoneFix> 
        </tadig-gen:PhoneFixList>
      - <tadig-gen:FaxList>
          <tadig-gen:Fax>9999999999999</tadig-gen:Fax> 
        </tadig-gen:FaxList>
      - <tadig-gen:EmailList>
          <tadig-gen:Email>[email protected]</tadig-gen:Email> 
        </tadig-gen:EmailList>
        </ContactPerson>
      </Contact>
I publish the SQL code following, but do not get any value returned.
SELECT extract(v2.individual_annex,'IndividualAnnex/ContactInformationList[Contact/@contactInformationID="111"]/ContactPerson/@GivenName')
FROM raex_annex_3_0_v2 v2
WHERE v2.agreement_id = 1
What would be the SQL if, for example, I wanted to return the "GivenName" of Joe?

Any help is greatly appreciated.

Thank you very much

Kind regards

Simon Gadd

Try:

IndividualAnnex/ContactInformationList/Contact\[@contactInformationID="111"\]/ContactPerson/t:GivenName

This expression puts the predicate on the Contact item. In your speech, that the predicate is placed on the ContactInformationList, the element parent contact and, therefore, you get always all Contact items returned, because they share the same parent.

Phil Fearon
http://www.sketchpath.com

Published by: user6119315 on May 16, 2009 06:59

Tags: Database

Similar Questions

  • for BPEL XPath query, escape the quotes

    Hello

    Can someone tell me how to correct this query. Basically, I need the last part in quotes to be somehow escaped and the compilation process.

    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/Property [@Name = "ID"]')

    The Xpath query component is as follows: /ns1:createObject/req/Object [bpws:getVariableData('counter')] / options/property [@name = 'Id']


    I tried follows him:

    single quotes around the double quotes
    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/Property [@name = '"' Id'" ']')

    using the ' & quot;
    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/property [@name = & quot;) ID & quot;] ")

    Using single quotes around Id
    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/Property [@Name = 'Id']')


    Kind regards

    Hello

    You can't escape quotes in the assign activity, the only solution is to use a processing activity.

    You can use one of the following in your plan of xslt to count nodes having the Id with quotes.

    If Id is an attribute then use the following syntax:

    If Id is an element can use the following syntax:

    I have

    Kind regards
    Diakité
    http://SOA-HOWTO.blogspot.com

    Published by: Dharmendra Dubey on October 15, 2008 20:37

    Published by: Dharmendra Dubey on October 15, 2008 20:39

    Published by: Dharmendra Dubey on October 15, 2008 20:39

  • The XPath query results do not get

    Hello

    This is the xpath query and xml. Query is works well but do not fetch all results.

    Select d.

    the left outer join CALC_RUN_XML

    XMLTABLE (XmlNamespaces (DEFAULT 'http://www.cigna.com/coreops/ccmi/internal/calculation/1 http://www.cigna.com/coreops/ccmi/client/2 ','' as "ns2"), )

    "/ calculation/calculationParameters/clientSelections / ns2:client ' to CALC_RUN_XML. CALC_RUN_XML

    columns

    clientId varchar2 (100) path ' @ns2: clientId',.

    Number of account varchar2 (100) path ' @ns2: account number ',

    path of varchar2 (100) branchNumber ' @ns2: branchNumber',.

    path of varchar2 (100) benefitPlanNumber ' @ns2: benefitPlanNumber',.

    path of varchar2 (100) benefitPlanVariationId ' @ns2: benefitPlanVariationId',.

    path of varchar2 (100) benefitClassNumber ' @ns2: benefitClassNumber',.

    path of varchar2 (100) clientAccountEffectiveDate ' @ns2: clientAccountEffectiveDate',.

    path of varchar2 (100) clientAccountTerminationDate ' @ns2: clientAccountTerminationDate'

    ) d

    1 = 1

    <? XML version = "1.0" encoding = "UTF-8" standalone = 'Yes'? >

    " < calculation = xmlns:ns2 ' http://www.CIGNA.com/coreops/CCMI/client/2 "xmlns =" http://www.Cigna.com/coreops/CCMI/Internal/calculation/1 ">

    < calculationParameters rateExhibitType = paymentFrequency "CAP" = "Monthly" calculationPeriod = "02" calculationYear = "2013" retroWindow = "Standard" retroWindowAmount = "" paymentDueDate = "2014-02 - 11 T 05: 00:00.000Z" > "

    < contractRateSheetSelections >

    < contractNumber selection '891' = >

    < rateSheetIds >

    < rateSheetId > 567 < / rateSheetId >

    < / rateSheetIds >

    < / selection >

    < / contractRateSheetSelections >

    < clientSelections >

    < ns2:client clientId = accountNumber "00358430" = "00358430" branchNumber = "A001" benefitPlanNumber = "MOAP001" benefitPlanVariationId = "00003250" benefitClassNumber = "A001" clientAccountEffectiveDate = "" 2009-06 - 01 T 04: 00:00.000Z "clientAccountTerminationDate =" 2199-12 - 31 T 05: 00:00.000Z "/ >"

    < ns2:client clientId = accountNumber "00358430" = "00358430" branchNumber = "A001" benefitPlanNumber = "MOAP001" benefitPlanVariationId = "00003250" benefitClassNumber = "A001" clientAccountEffectiveDate = "" 2009-06 - 01 T 04: 00:00.000Z "clientAccountTerminationDate =" 2199-12 - 31 T 05: 00:00.000Z "/ >"

    < / clientSelections >

    < / calculationParameters >

    < runHistory >

    < run runType = 'Se MOQUER"userId ="M59056"runDescription ="satish11"runDateTime =" "2014-02 - 11 T 17: 01:28.553Z" jobExecutionId = "2064" / > "

    < / runHistory >

    < / calculation >

    Thank you

    Partha

    Hello

    XML attributes belong to no namespace, unless explicitly qualified with a prefix.

    They do not inherit from their parents namespace either.

    So, in short, remove the attributes ns2 prefixes, and it should be OK:

    clientId varchar2 (100) path "@clientId."

    Number of account varchar2 (100) path "@accountNumber."

    path of varchar2 (100) branchNumber "@branchNumber"

    path of varchar2 (100) benefitPlanNumber "@benefitPlanNumber"

    path of varchar2 (100) benefitPlanVariationId "@benefitPlanVariationId"

    path of varchar2 (100) benefitClassNumber "@benefitClassNumber"

    path of varchar2 (100) clientAccountEffectiveDate "@clientAccountEffectiveDate"

    path of varchar2 (100) clientAccountTerminationDate '@clientAccountTerminationDate '.

  • Assign activity erros with the XPath query string returns multiple nodes.

    It comes to xml message we have with two elements < corecom:BusinessScopeReference > inside. How to assign the first < corecom:BusinessScopeReference > value of the other variable in the string.


    < variableentree >
    < xmlns:corecom fault = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" xmlns:default = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" xmlns = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" >
    < corecom:EBMReference >

    < corecom:BusinessScopeReference >
    < corecom:ID xmlns = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" xmlns:ebo = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" >
    Account: NUANCE (AIMA 17N9IL) < / corecom:ID >
    < / corecom:BusinessScopeReference >

    < corecom:BusinessScopeReference >
    < corecom:ID xmlns = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" xmlns:ebo = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" >
    CREATECUSTOMERPARTYMSG/39303832313732363632373734303732 < / corecom:ID >
    < / corecom:BusinessScopeReference >

    < / corecom:EBMReference >
    < / failures >
    < / variableentree >


    When I use the sub element assign, I get the error: "XPath query string returns multiple nodes." How to point to the specific element in the table.


    < assign the name 'AssignId' = >
    < copy >
    < variable from = part "Variableentree" = "Fault."
    Query = "/ corecom:Fault / corecom:EBMReference / corecom:BusinessScopeReference / corecom:ID" / >
    < variable = "business_object_name" / >
    < / copy >
    < / assign >


    Please suggest.

    Check if this useful BPEL foreach

  • On a CLOB XPath query?

    Anyone know if there is an easy way to run an XPath query against a CLOB column? I know it's simple, if the XMLType column, but only if it is a CLOB?

    CLOB store XML? If so, just use XMLTYPE (clob_column).

    SY.

  • XPath query language reference

    Apart from the three examples just in the 11 g Guide and the B2B Tech Note No. 011, is there a reference available for the XPath query language used by B2B? Is is possible to use complex XPath queries in Doc B2B definitions?

    B2B support W3C X-path which is an international standard for querying XML. As far as I KNOW, it does not support PXPATH. Contact the Oracle Support for formal confirmation.

    Kind regards
    Anuj

  • EOA: The query cannot be parsed, please check the syntax of your query.

    Hi all

    I have a 'DEVETL_OAE' scheme that OAE is set up. I am able to connect to this schema using Toad/Sqlplus and I can access a table "INFA8_INS_NEW" located in "ADW_DEV_REP" scheme.

    "ADW_DEV_REP" scheme gave a grant to select this table in a role of selection (i.e. ' ADW_DEV_REP_SELECT') SELECT 'DEVETL_OAE' 'INFA8_INS_NEW'.

    I can run a query in sqlplus and I am able to access this table as "select * from ADW_DEV_REP." INFA8_INS_NEW'.

    But, SAQ, when I try to create the region and source, when I'm trying to ' select * from ADW_DEV_REP. INFA8_INS_NEW' sql, I get the error message like "Query cannot be parsed, please check the syntax of your query. (ORA-00942: table or view does not exist) »

    What should I give manual grant to the schema 'DEVETL_OAE' on ' ADW_DEV_REP. INFA8_INS_NEW' table?

    Pls help.

    Thank you and best regards,
    Vinay

    "Indeed, you must grant select on ' ADW_DEV_REP. INFA8_INS_NEW' DEVETL_OAE (so not through a role).

  • Progressive, Question on the fields of dynamic/DocID/Query Question of profiling

    This may seem like a newb question but someone has a logical division of the BOM designation DocID?

    In the course, we are responsible to use DocID = 1 and DocID = 2, but when/why would you use DocID = 3 or higher?

    Any help would be greatly appreciated with the portion of dynamic fields/query string of the progressive profiling course.

    Thank you.

    The DocID is a complete example. You can actually assign the query string to be what you want. I recently use cmpID for the campaign ID, where I spent to map identity of the campaign and then sent the URL to redirect dynamically the campaign ID field. In my case, we worked with 10 different docs or goods, so we had to actually 10 unique codes. In this case we would have, for example cmpID = 483h76d; cmpID = 9j872hd, etc, etc. If you want to learn more about how you can use the query string values, see this post: how Progressive E10 profiling using the component of cloud - scroll down to step 6 and you'll see how to set up dynamic rules using query strings.

  • XML PIVOT QUERY QUESTIONS

    I'm new to PIVOT queries.  I was making reference to the discussion that follows, but ran into a problem.  https://forums.Oracle.com/message/9393302

    When I added the XML to format data, I started to have NULL values rather than what I was looking for.

    WITH (AS PIVOT_DATA)

    SELECT * FROM)

    SELECT THE REGION, FCST_PERIOD, PRIME_PART, FINAL_FORECAST

    OF XYZ WHERE FCST_PERIOD > = last_day (trunc (sysdate)) + 1 and FCST_PERIOD < = last_day (add_months(sysdate,12)) AND PRIME_PART IN ('BLAH')

    )

    PIVOT XML (SUM (FINAL_FORECAST) FOR FCST_PERIOD IN (SELECT DISTINCT FCST_PERIOD OF XYZ))

    )

    SELECT PRIME_PART, REGION,

    EXTRACTVALUE(FCST_PERIOD_XML,'/PIVOTSET/ITEM[1]/COLUMN[2]') FCST_PERIOD1,

    EXTRACTVALUE(FCST_PERIOD_XML,'/PIVOTSET/ITEM[2]/COLUMN[2]') FCST_PERIOD2,

    EXTRACTVALUE(FCST_PERIOD_XML,'/PIVOTSET/ITEM[3]/COLUMN[2]') FCST_PERIOD3

    OF PIVOT_DATA;

    RESULTS IN:

    PRIME_PARTREGIONFCST_PERIOD1FCST_PERIOD2FCST_PERIOD3
    BLAMIDWEST(NULL)(NULL)(NULL)
    BLAWEST-NV(NULL)(NULL)(NULL)
    BLASOUTH-EAST(NULL)(NULL)(NULL)
    BLAWEST-CA(NULL)(NULL)(NULL)
    BLASOUTHWEST(NULL)(NULL)(NULL)
    BLAEAST(NULL)(NULL)(NULL)

    The second part of my question is how would I do a group when you use a pivot query.  When I finished, I've has several parts and would like to group by REGION.

    Thank you!

    Names of elements and attributes in XML are case-sensitive.

    Try with:

    EXTRACTVALUE (FCST_PERIOD_XML, ' / PivotSet/item [1] /column [2]') FCST_PERIOD1

    There is also a good chance that EXTRACTVALUE is frowned upon in your version. Instead, use XMLQuery or XMLTable.

    That being said, using XML PIVOT just to grind it later into a number known columns is pretty useless.

    The same can be achieved much more efficiently with regular PIVOT operator (and if necessary analytical function).

    Post some examples of data in the table of your database and your final result expected to get useful assistance.

  • syntax error in query

    Hi all
    I have a question, and I got this error, any idea?

    Error starting at line 1 in command:
    WITH continent_table  AS
    (
    SELECT     en.country,en.continent
            ,ROW_NUMBER() OVER (PARTITION BY en.country ORDER BY en.percent DESC) ran
         FROM     encompasses en
         where ran=1
    )
    
    select co.name,con.continent,co.population/co.area as pop_density,ec.GDP,pop.Population_Growth,pop.infant_mortality,pol.government
    from country co
    join economy ec
    on co.code=ec.country
    join population pop
    on co.code=pop.country
    join politics pol
    on co.code=pol.country
    join continent_table  con
    on co.code=con.country
    Error at Command Line:6 Column:8
    Error report:
    SQL Error: ORA-00904: "RAN": invalid identifier
    00904. 00000 -  "%s: invalid identifier"
    *Cause:    
    *Action:
    IM using oracle 11g


    Thanks in advance


    best,
    David

    You cannot use "ran" in the WHERE clause since it is not yet defined.

    Wrap the first query in another.

    WITH q AS
    (
    SELECT     en.country,en.continent
            ,ROW_NUMBER() OVER (PARTITION BY en.country ORDER BY en.percent DESC) ran
         FROM     encompasses en
    ),
    continent_table  AS
    (
    SELECT * from q where ran=1
    )
    SELECT . . . FROM continent_table
    
  • Query does not work on my iPad (was: media query question)

    I am a site for mobile/tablet/Office of coding and while my office and the iphone respond to the CSS, my ipad does not work. The changes that I do take the tablet in dreamweaver, but when they go live the ipad does not. Of course, my media query must be incorrect, but I can't understand the question. Any help is very appreciated.

    http://gbetza.mydomain.com/WebService2/test/KathrynFee/2014/profile.html

    Thank you.

    Yes.  It is inevitable because smart phones are getting bigger while tablets are smaller & more.  He's always going to be some crossover.   Think of it this way, when a Tablet is behaving as a mobile device, he takes over the mobile network.  When the shelf behaves more like a desktop computer, you need the layout of office.

    Similarly, a great smartphone in landscape mode is likely to resemble the layout of your tablet.

    See the FluidGrid example below:

    http://ALT-Web.com/FluidGrid/Fluid2.html

    Office = 4-col layout

    Tablet = 2-col layout

    Mobile = 1-col layout

    For purposes of illustration, I added a thick border of gold at the disposal of the Tablet only.

    / * Tablet Layout: 481px to 768px. Inherits the styles of: Mobile layout. */

    @media only screen and (min-width: 481px) and (max-width: 768px) {}

    .gridContainer {width: 92%; border: 16px solid gold}

    }

    Nancy O.

  • XPath query using DONKEY with AIR3.9 for iOS app

    We build an app for iOS using AIR 3.9 where we load and parse the xml document so that we can read the path of images and download stuff on iOS device. To resolve this issue, we found a solution using XCode via DONKEY where query using XPath such as 'PerformXPathQuery', 'PerformXMLXPathQuery', 'xmlReadMemory"etc.. The code runs and when build Simulator itself on mac computer. But when we're packing DONKEY with AIR 3.9, it gives the error that says that: -.

    Error occurred during the application of packaging:

    For architecture armv7 httpd Undefined symbols:

    "_xmlReadMemory", referenced from:

    _PerformXMLXPathQuery in libnet.example.download.a (ExampleLib.o)

    LD: symbol not found armv7 architecture

    Compilation failed during execution: ld64

    I tried connecting binary with libraries such as 'libxml2.dylib', 'libxml2.2.dylib' and libz.dylib + added header files libXML to the header in the build properties search path, but had no help.

    our AIR 3.9 platform xml looks like: -.

    " < platform xmlns =" http://ns.Adobe.com/air/extension/3.9 ">

    < > 4.0.0 sdkVersion < / sdkVersion >

    < linkerOptions >

    < option > - ios_version_min 4.2 < / option >

    < option > - frame 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, it was missing the framework connects to the xPath library in platform.xml

    follow the instuctions from the link below: -.

    http://forums.Adobe.com/thread/1037904

    Thanks to the adobe team

  • syntax error xPath-&gt; position of the particular element in BPEL

    Hello

    I'm trying to get the position value of the particular BPEL element using xPath, but get the syntax error any idea?

    bpws:getVariableData ('outputVariable', 'payload','/ ns1:Employee / ns1:loc [bpws:getVariableData('currenctRecord')] / ns1:code')

    Thank you
    Ravi

    bpws:getVariableData('outputVariable','payload','/ns1:employee/ns1:loc[$currenctRecord]/ns1:code')

    use the expression in the expression builder above, and the same assign to the target node where you want, it will work

  • The search syntax of SQL query against the data type varchar2 preserving valid data.

    Have a data model that we are not allowed to change and the column in question is a varchar2 (20). The column has at this stage no foreign key to the list of valid values. So, until we can get those who control the data model in order to make the adjustments we need for a SQL query that root out us bad data on the hours fixed.

    Is what we expect to be good data below:

    -Whole number, without floating point
    -Length of 5 or less (greater than zero but less than 99999)
    -Text "No_RP" can exist.

    Request demo below works most of the time with the exception of 'or Column1 is null' is not contagious in the null record. I tried to change the logical terms around, but did not understand the correct layout still provide it. So help would be greatly appreciated it someone could put me straight on how to properly register a null value in the recordset that has been selected with other types of error for end users to correct their mistakes. Another thing, I suppose there could be a better approach syntactically to a call find all offender characters such as *, &, (and so on.)

    WITH Sample_Data AS (SELECT '0' collar OF DOUBLE UNION ALL)
    SELECT "2" collar OF DOUBLE UNION ALL
    SELECT "99999" col OF DOUBLE UNION ALL
    SELECT "100000" col OF DOUBLE UNION ALL
    SELECT '1 a' collar OF DOUBLE UNION ALL
    SELECT the "ABCD" OF DOUBLE UNION ALL pass
    SELECT 'A1' collar OF DOUBLE UNION ALL
    SELECT ' *' collar OF DOUBLE UNION ALL
    SELECT "/" pass OF DOUBLE UNION ALL
    SELECT '-' col OF DOUBLE UNION ALL
    SELECT ' ' collar OF DOUBLE UNION ALL
    SELECT "pass OF DOUBLE UNION ALL
    4. SELECT 5 6' collar OF DOUBLE UNION ALL
    SELECT "24.5" collar OF DOUBLE UNION ALL
    SELECT '-3' collar OF DOUBLE UNION ALL.
    SELECT 'A' collar OF DOUBLE UNION ALL
    SELECT 'F' OF DOUBLE UNION ALL cervical
    SELECT the 'Z' OF DOUBLE UNION ALL pass
    SELECT the pass 'Bye' FROM DUAL UNION ALL
    SELECT the "Hello World" OF DOUBLE UNION ALL pass
    SELECT "=" col OF DOUBLE UNION ALL
    SELECT "+" col OF DOUBLE UNION ALL
    SELECT '_' pass OF DOUBLE UNION ALL
    SELECT '-' col OF DOUBLE UNION ALL
    SELECT ' (' col OF DOUBLE UNION ALL)
    SELECT ')' collar OF DOUBLE UNION ALL
    SELECT '&' collar OF DOUBLE UNION ALL
    SELECT ' ^' collar OF DOUBLE UNION ALL
    SELECT '%' collar OF DOUBLE UNION ALL
    SELECT the pass of "$" OF DOUBLE UNION ALL
    SELECT the pass ' # ' TO DOUBLE UNION ALL
    SELECT ' @' collar OF DOUBLE UNION ALL
    SELECT '!' collar OF DOUBLE UNION ALL
    SELECT ' ~' collar OF DOUBLE UNION ALL
    SELECT "' collar OF DOUBLE UNION ALL
    SELECT '.' pass FROM DUAL
    )
    SELECT col from Sample_data
    WHERE (translate (col, '_0123456789', '_') is not null
    or length (col) > 5
    col = 0 or
    or col is null)
    and (upper (col) <>'NO_RP');

    One more thing, I also took the approach of the regular expression, but he could not understand. If anyone knows how to do with this approach, I would also appreciate learning this method as well. Below is a close because I had. Impossible to get a range to work as "between 0 and 100000", guessing because of the comparison of varchar2 and # even attempted using to_char and to_number.

    Select to_number (column1) from the testsql where REGEXP_LIKE (column1, ' ^ [[: digit:]] + $') ORDER BY to_number (column1) CSA;

    Thanks in advance for anyone to help.

    Nick

    Hello

    Thanks for posting the sample data in a useable form.
    It would be useful that you also posted the accurate results you wanted from this data. You want the same results as those produced by the query you posted, except that nulls should be included? If so:

    SELECT     col
    FROM     sample_data
    WHERE     CASE
             WHEN  UPPER (col) = 'NO_RP'               THEN  1
             WHEN  col IS NULL                    THEN -1
             WHEN  LTRIM (col, '0123456789') IS NOT NULL     THEN -2
             WHEN  LENGTH (col) > 5               THEN -3
                                           ELSE TO_NUMBER (col)
         END     NOT BETWEEN     1
                  AND          99999
    ;
    

    The requirement that pass! = 0 gives that much more difficult. You could test easily for an integer from 1 to 5 digits, but then you must have a separate condition to make sure that the chain was not '0', '00', '000', ' 0000 'or ' 00000'.
    (Unlike Solomon, I guess that do not want to choose no-0 numbers starting by 0, such as ' 007 'or ' 02138'.)

    Using regular expressions, you may lose a few keystrokes, but you also lose a lot of clarity:

    SELECT     col
    FROM     sample_data
    WHERE     REGEXP_LIKE ( col
                  , '^0{1,5}$'
                  )
    OR NOT     REGEXP_LIKE ( NVL ( UPPER (col)
                     , 'BAD'
                     )
                  , '^(([1-9][0-9]{0,4})|NO_RP)$'
                  )
    ;
    

    Published by: Frank Kulash, December 13, 2010 21:50

    Published by: Frank Kulash, December 13, 2010 22:11
    Added regular expression solution

  • Query question queries

    You can query a query created using queryNew()?

    When I try the following code, I get an error:

    "Query of queries syntax error.
    Meeting "qData. user. "Incorrect conditional expression, waiting for an a [as | null | between | in | comparison] condition."

    Code:

    < cfset qData = queryNew ("tool, user, community, fm01, fm02, fm03, fm04, fm05, fm06, fm07, fm08, fm09, fm10, fm11, fm12, fy") >
    < cfset temp = #queryAddRow (qData) # >
    < cfset temp = #querysetCell (qData, "tool", "empty") # >
    < cfset temp = #querysetCell (qData, "user", "Bob") # >

    < cfquery dbtype = "query" name = "chkQdata" >
    SELECT *.
    OF qData
    WHERE qData.user = 'Bob '.
    < / cfquery >

    I just tried the code you provided, adding two cfdump Tags (the first to empty the qData query and the second to empty the chkQdata query). Everything worked well exactly as you had it on Railo 3.1. It did not work (threw the error you got) on CF 8.0.1.

    If I deleted the WHERE clause of the query of chkQdata, it runs (no error) in CF 8.0.1.

    For that it works as you want in CF8, change the user column. This seems to be a keyword for CF8. While I didn't check exactly, if I change your original request to be 'empty' = tool, it runs. In addition, rename the column user usr generates the script runs correctly.

    Here is the code that I had to work in CF8 and Railo 3.1:

    SELECT *.

    OF qData

    WHERE the usr = "Bob."

Maybe you are looking for