revQueryDatabase returns different result sets compared to revDataFromQuery

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
golife
Posts: 103
Joined: Fri Apr 02, 2010 12:10 pm

revQueryDatabase returns different result sets compared to revDataFromQuery

Post by golife » Wed Dec 09, 2020 11:52 pm

LC 9.5.1 stable, Windows 10, IDE

So far, I used the database function revDataFromQuery(tab, CR, gConnectionID, tSQLStatement) on MySQl. It works fine. Now I need to retrieve blobs and started working with revQueryDatabase(gConnectionID,tSQLStatment) ... then taking the resulting cursor to retrieve the records using the recommended "convertCursorToArray @tResultA" as demonstrated in the Tutorials.

The first test query is simplest: "SELECT * FROM note" where "note" is the table name.
The second simple query: "SELECT note.id, note.desc, note.ts FROM note". (The MySQL I am using requires the table name in front of each column name.)

What is very strange is the result set:
1. revDataFromQuery returns 79 records in both queries -- and that is all there is.
2. revQueryDatabase returns 27 records only when using the second query, Why not all 79?
3. revQueryDatabase returns 20 records with the first query, why not all, and why different from 2.?

Is there a reason? Is there something I am missing? I could post the scripts if needed, but why even the same function call returns two different sets of data is a mystery to me.

Thanks for any insight...

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: revQueryDatabase returns different result sets compared to revDataFromQuery

Post by Bernard » Thu Dec 24, 2020 3:39 am

I can't see what's wrong with that Lesson that would result in these differences. As the revData... operations have been in use for 20 years or so, I think if your results were common this would have been picked up and resolved long ago.

How are you determining this discrepancy in result set size. Are you using revNumberOfRecords( resultSetID ) or are you looking in the array to see the count there? It often helps to try and determine where things are going wrong.

Post Reply

Return to “Databases”