Copies a record wholesale from a source to a target.
Syntax
RAW-TRANSFER
{ [ BUFFER ]buffer TO [ FIELD ]raw-field
|[ FIELD ]raw-field TO [ BUFFER ]buffer
|[ BUFFER ]buffer TO [ BUFFER ]buffer
}
[ NO-ERROR ]
|
- BUFFER
- Specifies a parameter is a buffer.
-
buffer
- A source or target database record.
Note: If the
source buffer contains only a partial field list, RAW-TRANSFER fails.
- FIELD
- Specifies a parameter is a raw-field.
-
raw-field
- A source or target data field of type RAW.
- NO-ERROR
- The NO-ERROR option is used to
prevent the statement from raising ERROR and
displaying error messages.
Example
The following ABL example performs a RAW-TRANSFER of a
newly created Customer record to the Record field of Replication-Log table:
TRIGGER PROCEDURE FOR REPLICATION-CREATE OF Customer.
CREATE Replication-Log.
ASSIGN
Replication-Log.Taskid = DBTASKID(LDBNAME(BUFFER Replication-Log))
Replication-Log.Table = 'Customer'
Replication-Log.Action = 'CREATE'.
RAW-TRANSFER Customer TO Replication-Log.Record.
|
For more information on database replication,
see OpenEdge Data Management: Database Administration.
Notes
- The RAW-TRANSFER statement has several variations:
- The "buffer to raw-field" variation copies the entire record from
the buffer to the raw field, prepending information on the source schema to the raw
field.
- The "raw-field to buffer" variation first checks that the source
schema information prepended to the raw field matches the schema of the buffer. Then
it creates a target record, if necessary. Finally it updates each key field in the new
record using values from the raw field, which forces indexing to occur.
- The "buffer to buffer" variation is the same as the "raw-field to
buffer" variation, except that the source is a record in another buffer.
- The RAW-TRANSFER statement respects database
triggers.
- You can marshal an OpenEdge database record so that it can be sent
across sockets by using the RAW-TRANSFER statement to put the record into
a RAW variable and then copying the RAW variable to a MEMPTR that is being written to a
socket. Use the PUT-BYTES function to do this. You can unmarshal database
records by using the GET-BYTES function and then
RAW-TRANSFER.
- At run time, the RAW-TRANSFER statement:
- Checks that the signatures of the source data and the target data
match.
- Compares source and target code page ids, and (if they are present
and different) translates the source's character data, writing any warnings to the
database log file and raising any error conditions.
- Creates the target record, if none exists, and runs all appropriate
CREATE and REPLICATE-CREATE triggers (unless the
DISABLE TRIGGERS FOR LOAD option is active for the target).
- Registers changes in key fields with the index manager by updating
each key field in the target when it differs from the source.
- Copies all data from the source record to the target record.
- Executes ASSIGN triggers for any modified fields
(unless the DISABLE TRIGGERS FOR LOAD option is active for the
target).
- When using the RAW-TRANSFER statement to copy a record
that contains a BLOB or CLOB field, the AVM skips the BLOB or CLOB field and stores the
Unknown value (?) in the BLOB or CLOB field of the target
record.