I have this program that extracts about 30,000 records out of an SQL Server database, and the operation is quick but not that quick, so I have the following procedure for reassuring the operator that things are moving along. It works fine, but is a bit old school. I thought that flashing a progress bar might be nice, but it seems that in order to operate the progress bar I have to know in advance how many records I will be processing. I am not seeing a way to do that with the REBOL ODBC interface. I insert the SQL into a command port or whatever it is called, and pick off the results one at a time, but I don't know how many I ultimately will be picking. Does anyone know if that information (the number of records returned) can be determined before actually processing them?
Thank you.
Old-school solution follows:
insert VISION-CMD SQL-PIDLOOKUP ;; Put an SQL string into the ODBC command port.
while [SQL-RESULT: pick VISION-CMD 1] [ ;; Pick off the results one at a time.
LINE-COUNTER: LINE-COUNTER + 1
if (0 = (remainder LINE-COUNTER 100)) [
print [LINE-COUNTER 'Table items processed']
]
... other processing for a single record
]