Page 1 of 1

revDataFromQuery has a limit?

Posted: Sun Dec 26, 2021 3:57 pm
by Samuele
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.

Re: revDataFromQuery has a limit?

Posted: Tue Dec 28, 2021 5:16 pm
by Klaus
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

Re: revDataFromQuery has a limit?

Posted: Sun Jan 02, 2022 3:04 pm
by Samuele
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

Re: revDataFromQuery has a limit?

Posted: Sun Jan 02, 2022 3:41 pm
by Klaus
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

Re: revDataFromQuery has a limit?

Posted: Sun Jan 02, 2022 5:34 pm
by Samuele
OK, thanks👍