revDataFromQuery has a limit?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm

revDataFromQuery has a limit?

Post by Samuele » Sun Dec 26, 2021 3:57 pm

hi, i'm working with MySql and livecode, when i use the function revDataFromQuery it doesn't show all the data from the database, any ideas of what could be the problem?
thanks.
Samuele.

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

Re: revDataFromQuery has a limit?

Post by Klaus » Tue Dec 28, 2021 5:16 pm

Buongiorno samuele,

hm, ususally the only limit is the available RAM!?

How "big" is the data, I mean how many records are in your database table
and how many will actually be fetched?

And please also show your script to fetch the data.


Best

Klaus

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm

Re: revDataFromQuery has a limit?

Post by Samuele » Sun Jan 02, 2022 3:04 pm

Klaus wrote:
Tue Dec 28, 2021 5:16 pm
How "big" is the data
not big, it's only some texts (names ecc.)
this is the script

Code: Select all

on Query
   -- check the global connection ID to make sure we have a database connection
   
   if gConnectionID is not a number then
      answer error "You're not connected"
      exit to top
   end if
   	
   -- construct the SQL (this selects all the data from the specified table) 
   put "Persons" into tTableName	-- set this to the name of a table in your database
   put "SELECT * FROM " & tTableName & " ORDER BY HighScore DESC, Username ASC" into tSQL
   	
   -- query the database
   put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
   	
   -- check the result and display the data or an error message
   if item 1 of tData = "revdberr" then
      answer error "Can't connect:" & cr & tData
   else
      put tData into field "ProvaData"
   end if
end Query
Samuele.

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

Re: revDataFromQuery has a limit?

Post by Klaus » Sun Jan 02, 2022 3:41 pm

Buongiorno Samuel,

hm, the script is correct, no idea why not all records are fetched?!
Does this only happen with this db/table? Maybe a server setting?
Cannot tell from afar...

Important hint:

Code: Select all

...
## This will not work, since that is NOT ITEM 1!
  ## if item 1 of tData = "revdberr" then
  ## use this:
  if tData begins with "revdberr" then
      answer error "Can't connect:" & cr & tData
   else
  ...
Best

Klaus

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm

Re: revDataFromQuery has a limit?

Post by Samuele » Sun Jan 02, 2022 5:34 pm

OK, thanks👍
Samuele.

Post Reply