|
Exporting BLOB Data |
|
|
RelDBQueryProcess and RelDBQueryDataSource, support exporting binary data stored in BLOB (Binary Large Object) type table fields to file system. By using this feature; with one query, the data stored in other type of fields can be retrieved and the binary data stored in BLOB fields can be exported to external files so that the web browsers can directly access them. An Export BLOB Data Definition can be made where the SQL statement query is but it must be enclosed with SQL comment symbols. Definition Syntax: _EXPORT_BLOB_DATA(export-directory; key-fields; blob-fields; change-detection-fields)
Parameters export-directory The name of the directory where the BLOB fields will be exported to. Although this definition can be made absolute or relative to the root directory of the web application, generally the using the relative definition makes sense; because the export directory should be accessible by the browsers.
key-fields The exported files should be named uniquely in order to prevent the file name collision. Therefore this parameter should be given one or more field names (separated with commas) whose values build a table based unique identity.
blob-fields The name of the BLOB fields whose values will be exported to external files. One or more (separated with commas) BLOB field names can be given. After each BLOB field name an ':' character and the extension name of the export file should be specified. This extension name is actually defines the content type of the binary data stored in the BLOB field.
change-detection-fields This optional parameter is used to detect a change in the current record. This way unnecessary exporting of the BLOB fields can be avoided. If one or more fields are available whose content can indicate the change in the current record you can define the names of the fields in this parameter. If it is not defined, then the BLOB export will be repeated once a ten-seconds.
Examples:
The definition can be processed conditionally where necessary.
The names of the files The files that contain the exported binary data are given unique names and those names are then stored into the related result field.
|