Difference between revisions of "COPY TO ARRAY"
Helengeorge (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(2 intermediate revisions by one user not shown) | |||
Line 14: | Line 14: | ||
==See Also== | ==See Also== | ||
− | [[AAVERAGE()]], [[ACHOICE()]], [[ACOPY()]], [[ADEL()]], [[ADIR()]], [[AFIELDS()]], [[AFILL()]], [[AINS()]], [[ALEN()]], [[AMAX()]], [[AMIN()]], [[APPEND FROM ARRAY]], [[ASCAN()]], [[ASORT()]], [[ASUM()]], [[AVERAGE]], [[DECLARE]], [[DIMENSION]], [[GATHER]], [[PRIVATE]], [[PUBLIC]], [[RELEASE]], [[RESTORE]], [[SAVE]], [[SCATTER]] | + | [[AAVERAGE()]], [[ACHOICE()]], [[ACOPY()]], [[ADEL()]], [[ADIR()]], [[AFIELDS()]], [[AFILL()]], [[AINS()]], [[ALEN()]], [[AMAX()]], [[AMIN()]], [[APPEND FROM ARRAY]], [[ASCAN()]], [[ASORT()]], [[ASUM()]], [[AVERAGE]], [[DECLARE]], [[DIMENSION]], [[GATHER]], [[IN_ARRAY()]], [[IS_ARRAY()]], [[LOCAL]], [[PRIVATE]], [[PUBLIC]], [[RELEASE]], [[RESTORE]], [[SAVE]], [[SCATTER]] |
==Description== | ==Description== | ||
− | The COPY TO ARRAY command allows all or part of the active table to be copied to the | + | The COPY TO ARRAY command allows all or part of the active table to be copied to the specified array, <array>. The target array need not be pre-defined, it will be created automatically. If the target array is pre-defined, the number of rows (dimension 1) will be truncated if it exceeds the number of rows copied from the table. Pre-declared arrays with insufficient elements to hold the copied rows/fields will be filled, but not extended. |
− | + | ||
− | + | ||
====FIELDS <field list>==== | ====FIELDS <field list>==== | ||
Line 46: | Line 44: | ||
[[Category:Table Basics]] | [[Category:Table Basics]] | ||
[[Category:Table Basics Commands]] | [[Category:Table Basics Commands]] | ||
+ | [[Category:Array Processing]] | ||
+ | [[Category:Array Processing Commands]] |
Latest revision as of 09:57, 23 April 2012
Contents
Purpose
Copy current table to an array
Syntax
COPY TO ARRAY <array>
[FIELDS <field list>]
[FOR <condition>]
[WHILE <condition>]
See Also
AAVERAGE(), ACHOICE(), ACOPY(), ADEL(), ADIR(), AFIELDS(), AFILL(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ASCAN(), ASORT(), ASUM(), AVERAGE, DECLARE, DIMENSION, GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER
Description
The COPY TO ARRAY command allows all or part of the active table to be copied to the specified array, <array>. The target array need not be pre-defined, it will be created automatically. If the target array is pre-defined, the number of rows (dimension 1) will be truncated if it exceeds the number of rows copied from the table. Pre-declared arrays with insufficient elements to hold the copied rows/fields will be filled, but not extended.
FIELDS <field list>
The optional FIELDS clause restricts the operation to those fields listed in <field list>. The <field list> contains a comma-separated list of field names.
FOR <condition>
The optional FOR clause restricts the operation to those records that match the specified <condition>.
WHILE <condition>
The WHILE clause will copy records so long as the <condition> is true (.T.), and is used to restrict the range of records processed. When used in conjunction with the SEEK or LOCATE commands, it allows a quick way of copying selected records. When the WHILE clause is used, the <scope> will default to REST.
Example
declare orders[10000,10] use suppliers copy to array orders for ord_date < date()
Products
Recital Server, Recital