Solved

query of queries

Posted on 2013-11-28
9
278 Views
Last Modified: 2013-12-12
I have a query of queries , now Under certain conditions I need to remove the record from the QoQ to keep the static query up to date. I know that QoQ has some limitations and does not support delete. Is there a way I can remove a record from the static query
0
Comment
Question by:erikTsomik
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 39683569
why can you just exclude it in the subsequent where conditions?
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 39683634
well just because I am building the query on the fly. Basically passing the query by reference to another function  and updating the query as needed (updating meaning deleting records)
0
 
LVL 50

Assisted Solution

by:Lowfatspread
Lowfatspread earned 167 total points
ID: 39683863
have you checked out this article?

http://www.bennadel.com/blog/1707-Running-UPDATE-And-DELETE-SQL-Statements-Using-ColdFusion-Query-Of-Queries.htm

I didn't get to the end of it but it seemed to be going along your lines of thought...

I'm just not sure how additive and complex your requirements are going to get....

the whole purpose of the qoq is to give you a "static" result set upon which to identify/analyse further subsets/ explorations .... once you physically start DELETING/ UPDATTING data that usually the time to rebase the data...

good luck
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 19

Author Comment

by:erikTsomik
ID: 39684102
I checked the ban nadel site and it requires the custom tag to be installed , I was hoping if somebody can route me to more elegant way
0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 166 total points
ID: 39684233
I don't think it's clear what you're trying to do.   You have a query, then you base a query of query on that query... now you want to run the QofQ again and limit the records?   This is all within one request/post to the server.   So, you need three different versions of the query, the main one, the QofQ and then a filtered down QofQ?

You have to keep in mind that QofQ is NOT faster than hitting the database again, you could just perform another query to the database.

You could also filter it by using a CFIF statement in the output loop, so you just skip over the records you don't want.

I think you need to give us some code for a more specific answer.
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39684756
Can you some code, so we can see and guide you properly
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 39686913
I understand that QoQ is not the fastest way to do things But I am building my recordset based on the result of the multiple queries, and compile into 1 recordset . And this all happened in the cfc and I am not sure that I can call a custom tag in the CFC itself.

What I am thinking I need to declare a java Array that will be always available to me , because I can simply remove an item from the array and then loop over the array and build the static query.

Correct me if I am wrong
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 39687040
If you need to maintain a list of these items between requests (between page views) then I think the best bet is absolutely the data base.   It will be the fastest and more efficient way of managing lists.   You can mark them off as you want them removed and then just query the ones that are not marked (or vise versa).   For clean-up, you can simply go through and delete the lists nightly if they are still around or you can delete them onSessionEnd
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 167 total points
ID: 39689042
> it requires the custom tag to be installed

Yeah, but if you look at it, ultimately all it's doing is running a QoQ to simulate a DELETE. Given that QoQ's don't support deletes,  why is it you can't just do what he's doing? ie Run a QoQ to exclude the records and use the new resultset ?
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question