I've copied the bulk of the VFP8 help entry for sending query results to an
array below. If you look at the output for the company column, the values
are all trim()/alltrim()'d -- a behavior I'd like to duplicate.
Unfortunately, the best I can do is to trim() the appropriate results by
hand after my queries execute. So...is the help entry wrong or am I missing
something?
-Lew
SELECT - SQL is a versatile command for querying tables and can direct query
results to an array.
To send SELECT - SQL query results to an array, specify the INTO ARRAY
clause with an array name. If the array doesn't exist, it is automatically
created. If the array does exist, it is redimensioned automatically to
accommodate the query results.
Example
In the following example, SELECT - SQL directs its query results to an array
named RESULTS:
SELECT DISTINCT a.cust_id, a.company, b.amount ;
FROM customer a, payments b ;
WHERE a.cust_id = b.cust_id INTO ARRAY results
DISPLAY MEMORY LIKE results
RESULTS Priv A TEST
( 1, 1) C "000004"
( 1, 2) C "Stylistic Inc."
( 1, 3) N 13.91 ( 13.91000000)
( 2, 1) C "000008"
( 2, 2) C "Ashe Aircraft"
( 2, 3) N 4021.98 ( 4021.98000000)
( 3, 1) C "000010"
( 3, 2) C "Miakonda Industries"
( 3, 3) N 9.84 ( 9.84000000)