Specifies any of the following (note that the data type of output-BLOB-value must be the BLOB type):
- Column specification
- Component specification
- Function call
- SUBSTR scalar function that produces a result that is the BLOB data type
The following rules apply to output-BLOB-value:
- Embedded variables and ? parameters can be specified in the argument for the function call or in the second or third argument of the SUBSTR scalar function that is specified in output-BLOB-value.
- If a BLOB column is specified in output-BLOB-value, the BLOB column cannot by itself be specified in a selection expression or in the output-BLOB-value for another WRITE specification.
Examples of invalid specifications are shown below:
SELECT WRITE(C1,***),C1 FROM ***
SELECT WRITE(C1,***),WRITE(C1,***) *** FROM ***
- If a FOR READ ONLY clause is specified, only a column specification can be specified in output-BLOB-value.
- A subquery cannot be specified in an argument of a function call or in an argument of the scalar function SUBSTR specified as an output BLOB value.
Specifies the prefix part of the file name that HiRDB will assemble. The data type of file-prefix must be VARCHAR and the length must not exceed 222 bytes.
The following can be specified in a file-prefix:
- Literal (character string)
- Embedded variable or ? parameter
The following rules apply to file-prefix:
- Specify an absolute path name, including directory, that is valid at the unit for the single-server or front-end server to which HiRDB is connected. Additionally, the HiRDB administrator must grant the file user the privileges (access type: full control) for performing all types of operations on the directory. In the case of the UNIX edition, the HiRDB administrator must grant the file user the privileges to read, write, and search within the directory.
- For the file separator to be specified as a file prefix, specify a forward slash (/) if the HiRDB server is UNIX, and specify a backslash (\) if the HiRDB server is Windows. For the characters that can be specified in a file name, the rules for the HiRDB server platform apply. However, if utf-8 or chinese-gb18030 is specified for the character code classification in the pdntenv command (for the UNIX edition, the pdsetup command), specify it using the ASCII code range.
- If only an embedded variable or a ? parameter is specified in the file prefix, the embedded variable or the ? parameter must have a simple structure.
- Use the default character set for the file prefix.
Specifies the file output mode as a numeric data type (INTEGER type is returned during execution of the DESCRIBE INPUT statement).
The following can be specified in file-output-option:
- Numeric literal
- Embedded variable or ? parameter
The following values can be specified:
Function | Value |
---|
Re-create (overwrites any existing file) | 0 |
Append (adds to the end of an existing file) | 1 |
Overwrite disable (flags an error if an existing file is encountered) | 2 |
Asynchronous output (requests asynchronous output from the operating system) | 4 |
- Note
- The asynchronous output option can be specified in combination with re-create, append, or overwrite disable. When asynchronous output is combined with another option, specify the value that is the logical union of the asynchronous output option's value and the value for the other option. When the asynchronous output option is not specified, HiRDB requests synchronous output (immediate WRITE) from the operating system.
If only an embedded variable or a ? parameter is specified in the file prefix, the embedded variable or the ? parameter must have a simple structure.
Retrieval examples using the file output facility involving BLOB data are shown below:
(a) Retrieving BLOB columns
Retrieve columns C1 and C2 from Table T1, writing BLOB data from C1 to a file and acquiring the file name:
![[Figure]](figure/zw2s0430.gif)
(b) Retrieving abstract data types with the BLOB attribute
From table T1, retrieve column ADT1 such that CONTAINS() is TRUE, writing a BLOB value, which is the result of passing the column value to an argument of EXTRACTS(), to a file, and acquiring the file name (this example illustrates the case in which all columns are retrieved).
![[Figure]](figure/zw2s0440.gif)