Page 1 of 1
Number of records retrieved from sql
Posted: Thu Feb 19, 2015 11:35 am
by AlessioForconi
Hello everyone
having these instructions
Code: Select all
put "SELECT * from calcolo_ore" into tSQL
put revDataFromQuery(tab,return,dbID,tSQL) into tRecords
answer tRecords
recovery properly all the records, I try again with the answer tRecords.
How can I do, however, to know the number of records retrieved?
I saw that there revNumberOfRecords but I can not make it work.
Thank You
Re: Number of records retrieved from sql
Posted: Thu Feb 19, 2015 1:16 pm
by Klaus
Buongiorno Alessio,
like this:
Code: Select all
...
put "SELECT * from calcolo_ore" into tSQL
put revDataFromQuery(tab,return,dbID,tSQL) into tRecords
answer "Number of records:" && the num of lines of tRecords
...
"revNumberOfRecords" will only work with a database Cursor after using "revQueryDataBase".
Best
Klaus
Re: Number of records retrieved from sql
Posted: Thu Feb 19, 2015 4:43 pm
by AlessioForconi
Klaus wrote:Buongiorno Alessio,
like this:
Code: Select all
...
put "SELECT * from calcolo_ore" into tSQL
put revDataFromQuery(tab,return,dbID,tSQL) into tRecords
answer "Number of records:" && the num of lines of tRecords
...
"revNumberOfRecords" will only work with a database Cursor after using "revQueryDataBase".
Best
Klaus
thank you Klaus
The method that you indicated you work but I understand that they are on the wrong track.
Knowing the number of records recuperaati thought I could iterate through them to assign them to the data grid, but I chose the wrong method.
EDIT: I solved with this help 6591-converting-a-database-cursor-to-a-data-grid-array
Re: Number of records retrieved from sql
Posted: Thu Feb 19, 2015 5:42 pm
by Klaus
Hi Allessio,
if your datagrid is of type TABLE then you can simply:
Code: Select all
...
put "SELECT * from calcolo_ore" into tSQL
put revDataFromQuery(tab,return,dbID,tSQL) into tRecords
##answer "Number of records:" && the num of lines of tRecords
set the DGTEXT of grp "your datagrid here" to tRecords
## Done :-)
...
Best
Klaus
Re: Number of records retrieved from sql
Posted: Fri Feb 20, 2015 6:08 pm
by AlessioForconi
Hi Max
it's really that simple?
Thank you

Re: Number of records retrieved from sql
Posted: Fri Feb 20, 2015 6:12 pm
by Klaus
AlessioForconi wrote:Hi Max...
COME ON!
Re: Number of records retrieved from sql
Posted: Fri Feb 20, 2015 6:29 pm
by AlessioForconi
Klaus wrote:AlessioForconi wrote:Hi Max...
COME ON!
Ooooppppssss
Hi Klaus

Re: Number of records retrieved from sql
Posted: Fri Feb 20, 2015 7:06 pm
by Klaus
AlessioForconi wrote:Klaus wrote:AlessioForconi wrote:Hi Max...
COME ON!
Ooooppppssss
Hi Klaus

