BUFFER-EXPORT( ) method
- Last Updated: February 11, 2026
- 5 minute read
- OpenEdge
- Version 13.0
- Documentation
Converts data from the buffer object to a standard character format and writes it to the current output destination or to a named output stream. You can use data exported to a file in standard format as input to other ABL procedures.
The method returns TRUE if at least one field was exported from the record, and FALSE if no fields were exported.
Return-type: LOGICAL
Applies to: Buffer object handle
Syntax
|
- stream-handle
- A HANDLE expression that resolves to the handle of a named stream (defined via the
DEFINE STREAMstatement. The handle is aSTREAM-HANDLEobject). The default value is the Unknown value (?), which means that the method uses the current unnamed stream (opened via theOUTPUT TOstatement). - delimiter
- A CHARACTER expression that evaluates to a single character to be used as the delimiter between field values. The default is a space character. A multi-byte character is allowed. If you specify more than one character, ABL uses the first character as the delimiter.
- except-list
- A CHARACTER expression that evaluates to a comma-separated list of field
names to be excluded from the export. The default value is the Unknown value
(
?), where no fields are excluded. Field names in except-list that do not match a field in the table are ignored. - no-lobs
- A LOGICAL expression indicating whether to ignore BLOB and CLOB fields in the export. If TRUE, BLOB and CLOB fields are ignored during the operation. If FALSE, BLOB and CLOB fields are exported along with the other fields. The default value is FALSE (that is, BLOB and CLOB fields are included in the operation).
Examples
In this example, a dynamic query reads all records from the
Customer
table and exports the records to the file opened by the OUTPUT TO
statement:
|
This example shows how you can use a named stream:
|
Notes
- The method may be called on a buffer object whether the record is for a database table or a temp-table.
- The method cannot be part of a multi-assignment statement. If it is, the compiler raises an error.
- Like the
EXPORTandIMPORTstatements, RECID fields are not automatically included for database tables forBUFFER-EXPORT()andBUFFER-IMPORT(). However, you can explicitly reference them in theBUFFER-EXPORT-FIELDS()andBUFFER-IMPORT-FIELDS()methods. - For temp-table fields, fields of type ROWID or
Progress.Lang.Objectare not allowed. You must exclude any fields of those types via the except-list parameter for the method to work. - The method raises an error if:
- a stream-handle is provided and it’s not a valid handle to a named stream or is not open for writing.
- the except-list has an element of an array field (for
example,
field-name[1]). You can only exclude the field as a whole and not given elements in the array field. - the user does not have read access to the database table.
- a temp-table contains a ROWID or
Progress.Lang.Objectfield and the fields are not excluded. - an error occurs when reading a record field.
- The method must follow an
OUTPUT TOstatement, which redirects the output destination. You cannot write data to the screen. - Other procedures can use the data exported with the
BUFFER-EXPORT()method as input by reading the file with theINSERT,PROMPT-FOR,SET,UPDATEorIMPORTstatements, andBUFFER-IMPORT()method. - The exported data is in a standard format to be read back into ABL. The order of the fields
exported is the order of the fields in the table definition. All character
fields are enclosed in quotes (
"") and quotes contained in the data you are exporting are replaced by two quotes (""). A single space separates one field from the next. An Unknown value (?) is displayed as an unquoted question mark (?). - There are no trailing blanks, leading zeros, or formatting characters (for example, dollar signs) in the data.
- ABL exports logical fields as the value YES or NO.
- When exporting records that contain a BLOB or CLOB field, the AVM creates a
separate object data file with the code page embedded in the filename and with a
file extension of .blb. The filename is stored in the BLOB
or CLOB field of the exported record. (When importing records that contain a
BLOB or CLOB field, the AVM uses this filename to locate the object data file
associated with each record.) If the BLOB or CLOB field contains the Unknown
value (
?), the AVM stores the Unknown value (?) in the BLOB or CLOB field of the exported record and does not create an object data file. If the BLOB or CLOB field contains a zero-length object, the AVM creates a zero-length object data file. The AVM raises the ERROR condition if an object data file cannot be created. - The
BUFFER-EXPORT()method creates large object data files in the directory specified as the output destination in theOUTPUT TOstatement, by default. You can use theLOB-DIRoption on theOUTPUT TOstatement to specify the directory in whichBUFFER-EXPORT()creates the BLOB and CLOB data files. - Use the no-lobs parameter to ignore large object data when exporting
records that contain BLOB or CLOB fields. When you specify YES for the
no-lobs parameter, the AVM stores the Unknown value
(
?) in the BLOB or CLOB field of the exported records and does not create the associated object data files. - For DATETIME and DATETIME-TZ data, the data format is fixed and conforms to the
ISO 8601 standard for date/time representations
(
YYYY-MM-DDTHH:MM:SS.SSS+HH:MM). For DATETIME, there is no time zone offset. - If you specify the delimiter parameter with a delimiter other than a
space character, you must specify the same delimiter character in a subsequent
IMPORTstatement,BUFFER-IMPORT()method, orBUFFER-IMPORT-FIELDS()method that loads the data. - The method is sensitive to the Date Format (
-d), Century (-yy), and European Numeric Format (-E) parameters. When loading data with theIMPORTstatement,BUFFER-IMPORT()method, orBUFFER-IMPORT-FIELDS()method, use the same settings that you used with the export statement/methods. - For more information, see Export and import data dynamically using buffers in Develop ABL Applications.
See also
BUFFER-IMPORT( ) method, BUFFER-EXPORT-FIELDS( ) method, BUFFER-IMPORT-FIELDS( ) method, EXPORT statement, IMPORT statement, OUTPUT TO statement