Large database records

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Large database records

Post by tasdvl9 » Tue May 27, 2014 12:34 am

Hello,

I'd like to be able to use dbGet and dbLimit when the records in my database exceed a certain amount.

For instance:

If my MySql database has a total of 400,000 records I'd like to be able to set the dbLimit to 1000, pull down those
1000 records, add them to my datagrid and then retrienve the next 1000 and keep adding to my data grid. Does this
seem reasonable? The reason I ask is because pulling down 400,000 records takes a great deal of time and I'd like the
user to see progress as the records are being pulled down.

Thanks!

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Large database records

Post by bangkok » Tue May 27, 2014 7:35 am

What do you mean by "dbLimit" and "dbGet" ? Those are not regular LiveCode functions.

Regarding your idea, yes it's possible. You would have to use tricks to "refresh" the display (look at "wait 0 milliseconds") and/or allow user interactions ("wait 0 milliseconds with messages")

You could just handle a "progress indicator" (look for examples of "progress bar")
http://lessons.runrev.com/s/lessons/m/4 ... gress-Bar-

http://ftp.runrev.com/forums/viewtopic.php?f=49&t=11538

But may I ask :
-what's the point (from the user point of view) to get... 400 000 rows in a Datagrid ? ! You want him to be able to browse/read all those 400 000 records ?
;-)

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Large database records

Post by dave.kilroy » Tue May 27, 2014 9:14 am

bangkok, dbLimit and dbGet are from Andre Garzia's lovely dbLib http://andregarzia.com/pages/en/dblib/

tasdvl9, yes it looks like you can use dbLimit for your first 'fetch' from the database - but I don't see a way to progressively get second and subsequent 'bites' from the database. So it may be you could use dbLimit for your first 'fetch' and from the returned data get enough information to build a modified SQL query (with another dbLimit) - and rinse and repeat until you have pulled down all the data you need.

But if you could find a way of redesigning things so that you don't need to pulldown such huge numbers of records then I'm sure your life, and your app, would be happier :)

Kind regards

Dave
"...this is not the code you are looking for..."

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Large database records

Post by Klaus » Tue May 27, 2014 1:27 pm

Hi tasdvl9,

maybe this datagrid function can help here?
http://lessons.runrev.com/m/datagrid/l/ ... ts-of-data


Best

Klaus

Post Reply