Solved

Pagination of multiple feeds/queries

Posted on 2007-12-06
6
630 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

16 Experts available now in Live!

Get 1:1 Help Now