Command APPEND FROM Professional
Appends records from a source table into the current workarea
APPEND FROM <cSourceTableName> [FOR <cForCondition>] [VIA <cDBE>]
The function appends the content of the specified table to the current selected workarea. The source table has to exist.
The command APPEND FROM will be entirely processed on the ADS server. This makes it necessary that both, source and target table, must be ADS driven tables and the FOR condition must be executable by the ADS server. If one of those preconditions can not be fulfilled, the APPEND FROM command will be executed by the client (see \SOURCE\SYS\DBBULK.PRG). The same applies if options like REST, WHILE or ALL as supported by Xbase++ are used. This is because the ADS server does not provide such a functionality. For more details about APPEND FROM see the Xbase++ Online Documentation.
#include "ads.ch"
#include "adsdbe.ch"
// Load ADSDBE as default database engine.
PROCEDURE DbeSys
IF !DbeLoad( "ADSDBE" )
Alert( "ADSDBE could not be loaded!" )
ENDIF
DbeSetDefault( "ADSDBE" )
RETURN
PROCEDURE Main
// Connect to database server.
LOCAL cConnect := "DBE=ADSDBE;SERVER=\\ALASKA\VOL1"
LOCAL oSession := DacSession():new( cConnect )
IF !oSession:isConnected()
Alert( "Connection to server could not be established!" )
QUIT
ENDIF
// open table on ADS server
USE Test NEW SHARED
// appends all records matching the FOR condition to
// the current workarea.
APPEND FROM MyBackup FOR Age < 20
// Close databases and disconnect from server.
DbCloseAll()
oSession:disconnect()
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.