Solved

Pagination of multiple feeds/queries

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

13 Experts available now in Live!

Get 1:1 Help Now