The following table summarizes the support functions for opaque data types.
Function | Purpose | Reference |
---|---|---|
input | Converts opaque data from its external text representation to its internal representation. Supports insertion of data in text format into a column of the opaque type. Requires an implicit cast from the LVARCHAR data type to opaque data type. | page Input Support Function |
output | Converts opaque data from its internal representation to its external text representation. Supports selection of data from a column of the opaque type in its external text format. Requires an explicit cast from the opaque data type to LVARCHAR opaque data type. | page Output Support Function |
receive | Converts opaque data from its external binary representation on the client computer to its internal representation on the database server computer. Supports insertion of binary data into a column of the opaque type. Requires an implicit cast from the SENDRECV data type to the opaque data type. | page Receive Support Function |
send | Converts opaque data from its internal representation on the database server computer to its external binary representation on the client computer. Supports selection of binary data from a column of the opaque type. Requires an explicit cast from the opaque data type to the SENDRECV data type. | page Send Support Function |
import | Performs processing of opaque data for bulk load of text data in a column of the opaque type. Requires an implicit cast from the IMPEXP to the opaque data type. | page Import Support Function |
export | Performs processing of opaque data for bulk unload of text data from a column of the opaque type. Requires an explicit cast from the opaque to the IMPEXP data type. | page Export Support Function |
importbinary | Performs processing of opaque data for bulk load of binary data in a column of the opaque type. Requires an implicit cast from the IMPEXPBIN to the opaque data type. | page Importbinary Support Function |
exportbinary | Performs processing of opaque data for bulk unload of binary data from a column of the opaque type. Requires an explicit cast from the opaque to the IMPEXPBIN data type. | page Exportbinary Support Function |
streamread | Converts opaque data from its stream representation to its database server internal representation. | |
streamwrite | Converts opaque data from its internal representation on the database server to its stream representation. | |
assign | Performs any processing required before the database server stores opaque data to disk. Supports storage of opaque data for INSERT, UPDATE, and LOAD statements. | page The assign() Function |
destroy | Performs any processing necessary before the database server removes a row that contains an opaque data type. | page The destroy() Function |
lohandles | Returns a list of the embedded large-object handles in the opaque data type. | page Handling Smart Large Objects |
compare | Supports opaque data types during ORDER BY, UNIQUE, DISTINCT, and UNION clauses, and BETWEEN comparisons. Also supports CREATE INDEX for B-tree indexes. | page Comparing Data |
deepcopy | Supports multirepresentational data types as function return values | page *** |
update | Supports in-place update on smart large objects | page The update() Function |
Most support functions can have arbitrary names. The database server identifies a support function by the task that it needs to perform. For example, if the client binds a binary value to INSERT, the database server looks for a cast function in the syscasts system catalog table that converts the UDT value from its external binary format (SENDRECV) to the opaque data type.
The following functions must be named explicitly: compare(), assign(), destroy(), update() and deepcopy(). However, the names are not case sensitive. That is, you can name the function compare() or Compare().
It is recommended that you give your support functions names that help document the purpose of the function. For example, if your opaque data type is named sphere, you might name the receive and send functions sphere_receive() and sphere_send().
Whenever possible, you should create the support functions as NOT VARIANT for better performance. For information about variant and non-variant functions, refer to Returning a Variant or Nonvariant Value.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]