Solved

query of queries

Posted on 2013-11-28
9
272 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
Comment Utility
why can you just exclude it in the subsequent where conditions?
0
 
LVL 19

Author Comment

by:erikTsomik
Comment Utility
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
Comment Utility
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
 
LVL 19

Author Comment

by:erikTsomik
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 166 total points
Comment Utility
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 15

Expert Comment

by:myselfrandhawa
Comment Utility
Can you some code, so we can see and guide you properly
0
 
LVL 19

Author Comment

by:erikTsomik
Comment Utility
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
Comment Utility
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
Comment Utility
> 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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)

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now