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."

Tags: ColdFusion

Similar Questions

  • query of queries case-sensitive

    Hello

    I have a question regarding this issue.  I am pulling data from an xml file and dump these data in the query of queries and their output.  The problem is when I try to order the CSA query, the stem will be high and fewer will be on the bottom.  Is it possible to sort them before the dump in query data?  Or ways around this?

    Thank you.

    functions upper() and lower() SQL function in q.

  • Query of queries error

    I use the same data source to create a query of queries, but one of my questions is not recognized. The codes and messages are the following:

    You do not use the datasource with a query of query property
    tag. When you do a query of query you are dealing with record sets
    memory. Delete the "datasource" setting in the third tag.

  • Zoom on query of queries

    I use stand-alone ColdFusion 9

    I'm still a little new to this, but I found code of exploration down that fits my needs for my application. It uses a query of queries which, to a certain extent, I understand. My problem is when I want to take down a few steps further. The first query lists products that are associated with related by-products. By clicking on a product, it will display a list of related subcategories. I would then each by-product a link to a detail page, but I don't know if my link of by-product code is correct, and I'm not sure what the page detail request should look like to show this specific detail of by-product. Here is the code I have so far:

    The exploration down product page:

    < cfquery name = "GetDetail" datasource = cachedwithin "mm_instance" = "1" >
    SELECT products.productID, products.product, instance.instances
    OF products, Instance, ProductInstance
    WHERE products. ProductID = ProductInstance.productID AND ProductInstance.instanceID = instance.instanceID
    < / cfquery >
    < cfquery dbtype = "query" name = "zoom on" >
    SELECT DISTINCT productID, product
    OF GetDetail
    ORDER BY product
    < / cfquery >

    < cfoutput query = "Zoom on" >
    < table width = "100%" id = "box" >
    < b >
    < td valign = "top" width = "510" id = "prodname" > < a href = "Inst_List.cfm? ProductID = #DrillDown.ProductID # "> #DrillDown.product # < br > < /a > < table >"
    < /tr >
    < /table >
    < / cfoutput >

    By-product (or Instance) exploration to the bottom of the Page:

    < cfquery name = "GetDetail" datasource = cachedwithin "mm_instance" = "1" >
    SELECT products.productID, products.product, instance.instances
    OF products, Instance, ProductInstance
    WHERE products. ProductID = ProductInstance.productID AND ProductInstance.instanceID = instance.instanceID
    < / cfquery >
    < cfquery dbtype = "query" name = "zoom on" >
    SELECT instances, productID
    OF GetDetail
    WHERE GetDetail.productID = #url.productID #.
    ORDER BY product
    < / cfquery >

    < cfoutput query = "Zoom on" >
    < table width = "100%" id = "box" >
    < b >
    < td valign = "top" width = "510" id = "prodname" > < a href = "Inst_Detail.cfm? productID = #DrillDown.productID #" > #DrillDown.instances # < /a > < table >
    < /tr >
    < /table >
    < / cfoutput >

    By-product of detail page:

    Don't know what this query should look like

    Thank you!

    You are using too many requests.  On the first page, just select a different set of products and their identification card, unless you need the value of the instance for something else.  On your exploration down the page, you must select all products again.  Simply select one of the variable url.

  • Query of queries: error when you try to fake Left Outer Join

    Hello

    I'm trying to reproduce a left outer join, combining two query of queries using a method I find here

    However, I get an error message...

    Here is the code I use...

    < cfquery dbtype = "query" name = "qry" >
    SELECT *.
    OF returnQry, returnQry2
    WHERE returnQry.mediumImage = returnQry2.mediumImage
    ORDER BY returnQry.name
    < / cfquery >

    < name cfquery = "returnQry3", dbtype = "#application.mx #" >
    SELECT *.
    OF trackmeanings t
    < / cfquery >

    < cfquery dbtype = "query" name = "endQry" >
    SELECT name, nameRcd, mediumImage, comments COUNT (sMessage)
    OF qry, returnQry3
    WHERE qry.name = returnQry3.sNameTrack

    UNION

    SELECT name, nameRcd, mediumImage, comments COUNT (sMessage)
    OF qry, returnQry3
    WHERE #qry.name # NOT IN (#QuotedValueList (returnQry3.sNameTrack) #)
    GROUP BY name, nameRcd, mediumImage
    < / cfquery >

    When I try to use the query output in a page, I get the error message "incorrect conditional expression, waiting for an a [as |]» null | between | in | "comparison condition.

    Anyone have any ideas?

    Thank you very much

    The items in the list should be cited.  Since you are using quotedvaluelist, it's weird that they aren't.  However, if you use cfqueryparam, list = Yes, you should have better luck.  Among other things, it will protect you against the apostrophe in names.

  • Error running query of queries

    Hello

    I am in the process of updating my site in CF5 to CF9 and I get a "query of query error" on the following code each time I have add the first point to my shopping cart. If I add a second element, the error disappears. Here are two pieces of keys to the code where I pull the item from the database information and then use the query requests to merge the query with the amount of shopping cart.

    <!-get-> Product Details

    < CFQUERY NAME='GetDetails'

    DATASOURCE = ' #request.ds # '

    Username = ' #request.dsuser # '

    PASSWORD = ' #request.dspass # ' >

    SELECT
    ItemNo,

    Agenda,

    Grades,

    Price,

    ImageSmall

    DE Products
    ItemNo IN (#QuotedValueList(GetCart.ItemNo) #)
    < / CFQUERY >

    <!-add the column "OrderQty"->

    < CFQUERY NAME="GetList" DBTYPE="query">

    SELECT
    GetDetails.ItemNo YOU ItemNo,

    GetDetails.Item point, AS

    GetDetails.Grades AS Grades,

    AS price, GetDetails.Price

    GetDetails.ImageSmall AS ImageSmall,

    GetCart.Quantity AS OrderQty

    DE GetDetails, GetCart
    GetDetails.ItemNo = GetCart.ItemNo
    < / CFQUERY >

    This is the error I get. The line number refers to the Q of Q above.

    Error running query of queries.

    Comparison = runtime exception.
    Comparison of Type incompatible Exception: on the left side and right side of the comparison operator "=" have incompatible types.
    Type of expression left side = "VARCHAR".
    Expression type side right hand = "DATE".

    I tried a lot of things affect a 'string' type to the right, but nothing seems to work.

    I would be very happy any help that I can get as I've spent countless hours trying to figure this.

    Thank you
    Steve

    Looks like the GetCart query is generated with functions to query coldfusion as opposed to a database query.  It also seems that the QueryNew function has the names of the fields, but not the types of data.  This means some trys to ColdFusion for the type of basic data on the first rows of data.

    Or it could be something else.

  • Can't find answer to a query of queries error

    Not only I saw this forum, but also google this problem, but the unfortunnately I have no chance to find the answer.

    I wrote this simple query:

    < cfquery name="test" dbtype="query">

    Select The SSN, date of birth de myquery where SSN <> '' OR Date of birth <>"

    < / cfquery >

    and I got this error:

    Error running query of queries.

    Exception of comparison when running <>.
    Unsupported Type comparison Exception: the <>operator does not support comparison between the following types:
    Type of expression left side = 'DOUBLE '.
    Expression type side right hand = "STRING".

    I tried the following and has not worked either, still got the same error.

    < cfquery name ="test" dbtype ="query">

    Select The SSN, date of birth de myquery

    NSS <> < cfqueryparam cfsqltype ="CF_SQL_VARCHAR" Value =""/ >

    OR Date of birth <> < cfqueryparam cfsqltype ="CF_SQL_VARCHAR" Value =""/ > < / cfquery >

    Ever met someone the same problem and know how to solve it?

    Select SSN, date of birth of myquery where cast (SSN to the varchar type) <> " OR cast (date of birth as varchar) <> "

  • Query of queries

    I am having trouble with the query of queries in CF5. I have included my select statement in the attached code.

    I want to be able to do now is to select totals of the original with a query of queries request. For example, I need to know my total return compared to my new visitors total visitors (for the love of the query, a new visitor is a person whose FirstVisitDate statement date range the user specified [attributes.start to attributes.end] and a return visitor is someone whose FirstVisitDate does nto fall within the specified range.)

    I tried something like:
    < cfquery dbtype = "query" name = "GetNewHits" >
    Select Count (Visitor)
    Of QueryVisitors
    Where FirstVisit
    Between #attributes.start #.
    and #attributes.end #.
    < / cfquery >

    The above query (when he returned to all results) returns all records in the original request (for me, it seems that the FirstVisit field doesn't recognize as a date field). Can anyone offer any suggestions? Thank you

    -Daniel Casper

    I wish I had the choice to upgrade, but the company is not apparent from a local server and our Web host is 2 releases from behind. I think I found a way to implement without however using Q of Q.

    I put an increment conditional when the results are displayed, which checks the date against my range of user and then increments a variable newhit if it corresponds to the range, or increments a variable returnhit if it is not. Until now it works fine. If someone needs it, the increment of conditional is:



    Thank you all for your suggestions.

  • Query of queries on 2 data sources

    I'm doing a query of queries on 2 different data sources. I run a gaming site and have a 2 programs that are used for tracking. One is written in php, by someone else, following members point State. The other, I wrote it in CF, allows members to set priorities in Treasury. Both are independent on my server. What I'm trying to do is set up so that the program I wrote to FC shows the number of points, each Member has. I know how interrogate separate tables, but how do I combine them? In addition, how can I set up so that it only shows members that match. that is, I want to assure you that if John Smith has 100 points, the query will show John Smith 100 points on my table. Here is what the query looks like I did. As you can see, I'm confused about and WHERE statements. I played with him last night and could not make it work. Thank you.

    You can try the same correction/idea of what I posted in thread http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=1&catid=7

    Copied/Pasted from this thread:

    You can read through the first query and add content to a query to temp attributing some kind of field and then read through the second query and add same temp with a kind of field to the query. Then do a query of this temp query.

  • Query of queries syntax error.

    Hi all

    I have the following query:

    < cfquery 'agent' datasource = name = 'Datasourcename' >
    SELECT * FROM quote where status = 'pending '.
    < isDefined ("form.agent") cfif >
    AND agent = ' #FORM.agent # '.
    < / cfif >
    < / cfquery >

    Then I have the following query of this query

    < cfquery name = "totalvalue" dbtype = "query" >
    SELECT total MySQL under the name OF the agent
    < / cfquery >

    However, I get the following error:

    Query of queries syntax error.
    Met «SUM (value.» List of incorrect selection,

    on line 20, which is:

    < cfquery name = "totalvalue" dbtype = "query" >

    now, I'm sure it's identical to what ive used before, but the error. totals query works fine when querying the database direct, only had this error when I changed it to query the master query.

    I appreciate any help in advance, that no matter how I look at I can't see whats wrong!

    In my view, that this value is a reserved word which originally is probably your current error. I would rename this column or alias it in your initial query. Also, I would like to add value WHERE IS NOT NULL to your Q-Q to cover your NULL values.

    Phil

  • 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.

  • BI Publisher data model / query question

    Hello

    I'm designing a report of BI Publisher where I need to show negative numbers in red. I'm perfectly fine with the help of the conditional formatting to do this (just using the default value is conditional formatting in the add-in in MS Word, that generates code like this:)

    <? If: number(Cost_-_MTD) < 0? > <? attribute@InContext:color;' Red '? > <? end if? >

    BUT...

    I have columns returning who sometimes have a NULL value in them, and when they have the value NULL, it causes the foregoing to the pipe upwards. So I thought, 'I'll just add IfNull() in queries defined in the model data, and who will take care of the problem... "

    that works - a little. Now, my problem is if I have to go back and change the query for some reason, I get an error "query cannot be parsed, please modify the query manually. I really don't want to do that, I wish that other developers do NOT have to manually change the queries.

    So my question is - is it possible to add in the IfNull() directly in the query designer, so it should not be changed manually from that moment?

    p.s. using IfNull OBIEE server as our data source.

    Thanks in advance,
    Scott

    I don't think there is a way to add the ifnull condition in the query designer. So, you will need to manually change the query...

    In your model so you can add additional control like this:
    <0?>...

    Thank you!

    Published by: BIPuser on Sep 17, 2010 09:20

  • 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.

  • 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.

  • SQL Query Question campaign

    I have a table that has at least 40 values that I need to use as variables in CCA. My question is. If I write the query as follows:

    SELECT AS $Var1 of the value1, value2 AS $Var2, ETC... I do for 40 fields. Would it work if I just do a query where I

    SELECT * FROM DBNAME WHERE CALLER = "$ANI."

    and then simply use the column as variables names?

    If you need 40 variables in your campaign to act on and use in logic, then you must list and assign all 40 as your first example.

Maybe you are looking for