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!
Large database records
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Large database records
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 ?

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 ?

-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: Large database records
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
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..."
Re: Large database records
Hi tasdvl9,
maybe this datagrid function can help here?
http://lessons.runrev.com/m/datagrid/l/ ... ts-of-data
Best
Klaus
maybe this datagrid function can help here?
http://lessons.runrev.com/m/datagrid/l/ ... ts-of-data
Best
Klaus