Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

bringing Data in Chunks Coldfusion

Hi, I am making one ajax call as:

$.ajax({ type:"POST", url:"welcome.cfm", data: data, success: function (html) { $('#message').html(html); } }); return false;

So now i want that i should return 100 records first time it calls that Page, now i want to apply the Paging to that also. So when i cick the next record or any number in paging say 5, it should display that data and make an ajax call to get that data, this way i think it will be better to handle millions of records!

Also i cannot use cfgrid, jquery preferred. if i can get the data as JSON and parse on client ide, i think that can make performance faster!

Guide


0
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
  • 6
  • 4
1 Solution
 
Gurvinder Pal SinghCommented:
if you are using mysql, then why don't you use limit and offset to get only that many number of rows from database
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i am not using mysql

sorry
0
 
Gurvinder Pal SinghCommented:
then which one?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
oracle
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
well if i get a sample for this that will be good
0
 
gdemariaCommented:
I would think you need to pass the page number to the ajax call, otherwise how will the query know which page of 100 records to return?   It may be even better to pass both page number and page size (in case you want to allow the user to vary their page size in the future)
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
yes that will be, but how. that is confusion
0
 
Gurvinder Pal SinghCommented:
something like

SELECT * FROM
   (SELECT ename FROM emp ORDER BY dbms_random.value())
WHERE rownum >= 1 and rownum <=10;

1 and 10 values can come from a variable which will be evaluated based on the pagination logic
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
nope used the between operator and worked like a charm Thanks
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
thanks for showing a way
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now