EXPORT STREAM stream STREAM-HANDLE handle DELIMITER character expression record EXCEPT field NO-LOBS
EXPORT STREAM stream STREAM-HANDLE handle memptr longcharSTREAM streamThe name of a stream. If you do not name a stream, the AVM uses the unnamed stream. See the DEFINE STREAM statement reference entry and the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces for more information on streams.STREAM-HANDLE handleSpecifies the handle to a stream. If handle it is not a valid handle to a stream, the AVM generates a run-time error. Note that stream handles are not valid for the unnamed streams. See the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces for more information on streams and stream handles.DELIMITER characterThe character to use as a delimiter between field values. The character parameter must be a quoted single character. The default is a space character.expression . . .To use EXPORT with a record in a table name used in multiple databases, you must qualify the record’s table name with the database name. See the Record phrase reference entry for more information.EXCEPT field . . .Directs the AVM to ignore large object data when exporting records that contain BLOB or CLOB fields.
OUTPUT TO customer.d.FOR EACH Customer NO-LOCK:EXPORT Customer.END.OUTPUT CLOSE.
OUTPUT TO custdump.FOR EACH Customer NO-LOCK:EXPORT Customer.CustNum Customer.Name Customer.CreditLimit.END.OUTPUT CLOSE.That procedure creates a text file, custdump, with one line for each Customer. This is a typical line of output:
1 "Lift Line Skiing" 58400
OUTPUT TO custdump2.FOR EACH Customer NO-LOCK:EXPORT DELIMITER ";" Customer.CustNum Customer.Name Customer.CreditLimit.END.OUTPUT CLOSE.
1;"Lift Line Skiing";58400
The EXPORT statement must follow an OUTPUT TO statement, which redirects the output destination.
The data is in a standard format to be read back into ABL. 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 (?).
If you use a single qualified identifier with the EXPORT statement, the Compiler first interprets the reference as dbname.tablename. If the Compiler cannot resolve the reference as dbname.tablename, it tries to resolve it as tablename.fieldname.
When exporting fields, you must use table names that are different from field names to avoid ambiguous references. See the Record phrase reference entry for more information.
When exporting records that contain a BLOB or CLOB field, the AVM creates a separate object data file using a unique filename with a .blb extension and stores that filename 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 EXPORT statement creates large object data files in the directory specified as the output destination in the OUTPUT TO statement, by default. You can use the LOB-DIR option on the OUTPUT TO statement to specify the directory in which the EXPORT statement creates the BLOB and CLOB data files.
Use the NO-LOBS option with the EXPORT statement to ignore large object data when exporting records that contain BLOB or CLOB fields. When you specify the NO-LOBS option, 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.
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.
EXPORT is sensitive to the Date format (-d), Century (-yy), and European numeric (-E) startup parameters. When loading data with the IMPORT statement, use the same settings that you used with the EXPORT statement.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |