Progress
Language Reference
BUFFER-COPY Statement
Performs a bulk copy of a source record to a target record by copying each source field to the target field of the same name. You can specify a list of fields to exclude from the bulk copy, or a list of fields to include in the bulk copy. You can also specify WHEN...THEN phrases. For each such phrase, BUFFER-COPY executes the THEN portion if the corresponding WHEN portion evaluates to TRUE.
SYNTAX
source
The source database table, buffer, temporary table, or work table.
EXCEPT field ...
A list of space-separated source fields to exclude from the bulk copy.
USING field ...
A list of space-separated source fields to include in the bulk copy. The USING option is simply a positive version of the EXCEPT option.
TO target
The source database table, buffer, temporary table, or work table.
ASSIGN assign-expression
A space-separated list of any valid Progress 4GL ASSIGN statements (without the EXCEPT option, which BUFFER-COPY already provides). BUFFER-COPY performs each assign-expression and automatically excludes the field on the left side (“destination”) of each assign-expression from the bulk copy-except for field extents (subscripted fields). If a field extent appears on the left side of an assign-expression, BUFFER-COPY does not automatically exclude that extent (such as customer.mnth-sales[1]) or the field as a whole (such as customer.mnth-sales) from the bulk copy.
NO-ERROR
Diverts any error messages from this statement to the ERROR-STATUS system handle and records the success of this statement in ERROR-STATUS:ERROR
NOTES
- At compile time, BUFFER-COPY:
- Complains if any source-target field pair is not type compatible
- Excludes from the bulk copy all EXCEPT field fields, and all assign-expression fields on the left side of the assignment
- Automatically excludes fields that appear in the source but not the target from the bulk copy
- Tries to bind unqualified field names that appear in the EXCEPT and USING options to the source buffer
- At run time, BUFFER-COPY:
- The BUFFER-COPY statement, like the VALIDATE statement, must appear within the scope of a FIND, a FOR EACH, or a CREATE statement that references the source table.
- If a BUFFER-COPY statement references a target buffer for the first time, Progress regards this reference as a “free reference” and scopes the buffer to the nearest enclosing block that can scope records. For more information on free references, see the chapter on block properties in the Progress Programming Handbook .
- With respect to transaction processing, Progress treats a BUFFER-COPY statement the same way it would treat equivalent ASSIGN statements. For more information on transaction processing, see the chapter on transactions in the Progress Programming Handbook .
- The compiler’s XREF facility automatically creates a REFERENCE for each field in the fields list, a TABLE-REFERENCE for the source and target buffers, ACCESS and UPDATE references for any fields in the ASSIGN option, and ACCESS (or UPDATE) references for each source (or target) field that participates in the bulk copy.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |