Solved

Pagination of multiple feeds/queries

Posted on 2007-12-06
6
632 Views
Last Modified: 2012-08-13
I am currently adding various feeds of hotels to our site www.hotelkingdom.com, where I have a glitch is that I need to enable pagination so that only 25 results are displayed per page. Pretty simple if I only had one query but what I have is a query of our personal inventory followed by an xml feed that I am converting on the fly into coldfusion query results. My question is if anyone has experience in adding pagination to a page where the results will be multiple queries one right after another.
0
Comment
Question by:buddhatech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
reitzen earned 250 total points
ID: 20421764
I would create a table on my local server where I would insert all data recieved from the remote feeds.

Then I could query my local source and include pagination, sorting, grouping, etc.

Be sure to create an IDENTITY column ("myIdendity") in your local table that starts at 1 (one) witha a seed of 1 (one).  Before you insert the data into your local table, truncate the table from the last load.  This will reset the IDENTITY column.  Then your query would look like this:

SELECT TOP 25 *
FROM myTable
WHERE myIdentity >= 1
0
 

Author Comment

by:buddhatech
ID: 20421929
I had actually considered doing that, but that still doesn't help with the existing hotels we have in our personal database I somehow need to merge the two. :)
0
 
LVL 6

Expert Comment

by:reitzen
ID: 20422562
This could be solved in two ways:

1. The INSERT data could come from a UNION query on your CF page that would mix your existing hotels with the external ones

INSERT INTO myTable (field1, field2, ...)
(    select * from myLocalHotels
     UNION ALL
     select * from myRemoteHotels
)

2.  Inserting the external and internal data in two steps.  Insert your existing hotels first and then the remote ones.

HTH
0
 
LVL 36

Assisted Solution

by:SidFishes
SidFishes earned 250 total points
ID: 20422635
without seeing your code....there's a couple of ways you might do this...

set your query results into a struct
use query of query
create an xml file using cffile and append the results, then read it back




0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

739 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