Text import and export

Text file import and export functions transfer the text representation of the opaque data type to and from a flat file.

This category is valid for the C and C++. BladeSmith generates this category by default.

Text file import and export functions enable bulk copy for opaque data types. When you copy data from a file into a database with PLOAD or the DB-Acess LOAD command, the server calls a text file import function to convert the incoming value to the server binary format. When data is copied out of the database into an external file, the server calls a text file export function to convert the value from server binary format to text file format.

You need text file import and export functions for opaque data types that include large objects or that are exported to a disk file. On copy-out, the text file export function creates a file on the client, writes the large object data to it, and then sends the name of the file as the data value for storage in the copy file. The text file import function takes the file name, opens it, and loads the large object data. This method stores large object data independent from the copy file so that the copy file is smaller and easier to read.

If you do not define text file import and export routines, the server calls the text input and output routines.

The names of these functions differ for different programming languages, as listed in the following table.
Table 1. Functions for different programming languages
Language Function names
SQL OpaqueImpT(), OpaqueExpT()
C OpaqueImportText(), Opaque ExportText()
C++ ImportText(), ExportText()
Java™ textImport(), textExport()