Home page  
Help >
COPY for Document Fields
Version 7.11
COPY for Document Fields

There are six ways of copying document fields. In the syntax below, "c" is a collection name, "tname" means table name, and "dcname" means document field name.

Form1:Document-to-File
COPY DOC [FROM] c tname dcname [TO] filename

Form2:File-to-Document
COPY DOC [FROM] filename [TO] c tname dcname

Form3:Document-to-Document in same record
COPY DOC [FROM] c tname dcname1 [TO] c tname dcname2

Form4:Moving a Document to another Document in same record
COPY/M DOC [FROM] c tname dcname1 [TO] c tname dcname2

Form5:Document-to-Document in another record
COPY DOC [FROM] c1 tname1 dcname1 [TO] c2 tname2 dcname2

Form6:Moving a Document to another Document in another record
COPY/M DOC [FROM] c1 tname1 dcname1 [TO] c2 tname2 dcname2

Options:
E -If an error occurs, do not abort the procedure
M -(Forms 4 and 6) Move rather than Copy
R -(Form 1 only) Suppress overstore notification
X -Suppress the command response
Y -Do not alter the command answer cells

Answers:
Ctl.Ans1 =1 if successful, 0 if not
Ctl.Ans2 =Zero
Ctl.Ans3 =Zero

Notes:
FROM and TO are optional and are allowed for readability. The source of the copy is always name1 and the target is always name2.

In form1 if the file name did not previously exist it is created by the COPY command. The file is a graphical file.

In all forms of COPY DOC only single records are involved. If you have many records to operate on you do them one at a time (a procedure involving a FETCH/n loop could be used to automate this process).

Use of the E option means if an error occurs, do not print an error message and do not terminate the current procedure. The application must check the %status variable to determine success or failure.

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.