Consultor Eletrônico



Kbase 13816: Another record copy method : EXPORT / IMPORT rec EXCEPT ...
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Another record copy method : EXPORT / IMPORT rec EXCEPT ...

Developers have several options to copy records. There are other
Knowledgebase entries for copying records using the metaschema files
and using the null device. The following alternative works well when
the developer wants to copy most of the fields from one record to
another (in the same table or different table) AND the number of
records to be copied is relatively small.

OUTPUT TO <filename>.
FOR EACH sourcerecord ... /* whatever selection criteria desired */
EXPORT sourcerecord EXCEPT <fieldlist>
/* fieldlist would include unique key fields */
END.
OUTPUT CLOSE.
INPUT FROM <filename>.
REPEAT ON ERROR UNDO, LEAVE:
CREATE targetrecord.
IMPORT targetrecord EXCEPT <fieldlist>.
END.


Since there is operating system I/O overhead, this solution works best
for quick-turnaround 4GL needs. If a large volume of records have to
be copied or if the function will be performed frequently, refer to
kbase #11040 about using the metaschema files to do this.

Progress Software Technical Support Note # 13816