Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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