Operating-system files

The DataBlade® API supports the functions for conversion between operating-system files and smart large objects.

Table 1. DataBlade API functions for conversion between operating-system files and smart large objects
DataBlade API function Description
mi_lo_from_file(), mi_lo_from_file_by_lofd() Copies data in an operating-system file to a smart large object
mi_lo_to_file(), mi_lo_filename() Copies data in a smart large object to an operating-system file
The file functions have a set of file-mode constants that are distinct from the open modes of smart large objects, as the following table shows.
Table 2. File modes for operating-system files
File mode for operating-system files Purpose
MI_O_EXCL Fail if the file already exists
MI_O_APPEND Append to the end of file
MI_O_TRUNC Truncate to zero if file exists
MI_O_RDWR Read/write mode (default)
MI_O_RDONLY Read-only mode (copying from operating-system files only)
MI_O_WRONLY Write-only mode (copying to operating-system files only)
MI_O_TEXT Text mode (default off)
MI_O_CLIENT_FILE Indication that file is on client computer (default)
MI_O_SERVER_FILE Indication that file is on server computer

You can include an environment variable in the file name path for the mi_lo_to_file(), mi_lo_from_file(), and mi_lo_from_file_by_lofd() functions. This environment variable must be set in the server environment; that is, it must be set before the database server starts.